From: Laurent Pinchart Date: Fri, 22 Aug 2025 00:27:21 +0000 (+0300) Subject: media: v4l2-common: Constify media_pad argument to v4l2_get_link_freq() X-Git-Tag: v6.18-rc1~133^2~229 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6234d0df236ab1a71c6bd75e4f5fa15339d5272b;p=thirdparty%2Fkernel%2Fstable.git media: v4l2-common: Constify media_pad argument to v4l2_get_link_freq() 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 Reviewed-by: Frank Li Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil --- diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 0574f5d685f88..6f8bce4d6b622 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -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 = {}; diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index e31b4434ea5d5..d8e23991a6563 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -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