]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: v4l2-common: Constify media_pad argument to v4l2_get_link_freq()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 22 Aug 2025 00:27:21 +0000 (03:27 +0300)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Sun, 31 Aug 2025 09:10:06 +0000 (11:10 +0200)
The v4l2_get_link_freq() macro doesn't modify the pad argument. Make it
possible to call it with a const media_pad pointer.

Link: https://lore.kernel.org/r/20250822002734.23516-2-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/v4l2-core/v4l2-common.c
include/media/v4l2-common.h

index 0574f5d685f88bf57619f0a2f785295375eded48..6f8bce4d6b622c6c417e7807d14485c14c5688e8 100644 (file)
@@ -550,7 +550,7 @@ static s64 v4l2_get_link_freq_ctrl(struct v4l2_ctrl_handler *handler,
        return freq > 0 ? freq : -EINVAL;
 }
 
-s64 v4l2_get_link_freq(struct media_pad *pad, unsigned int mul,
+s64 v4l2_get_link_freq(const struct media_pad *pad, unsigned int mul,
                       unsigned int div)
 {
        struct v4l2_mbus_config mbus_config = {};
index e31b4434ea5d5ada152f1dfc58b793ee8629f7d7..d8e23991a6563e8e12d7c4b5db8344dd984826f0 100644 (file)
@@ -579,7 +579,7 @@ int v4l2_fill_pixfmt_mp(struct v4l2_pix_format_mplane *pixfmt, u32 pixelformat,
  * * %-EINVAL: Invalid link frequency value
  */
 #ifdef CONFIG_MEDIA_CONTROLLER
-s64 v4l2_get_link_freq(struct media_pad *pad, unsigned int mul,
+s64 v4l2_get_link_freq(const struct media_pad *pad, unsigned int mul,
                       unsigned int div);
 #endif