]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: i2c: og01a1b: Use generic v4l2_subdev_get_fmt() to get format
authorVladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Thu, 26 Feb 2026 13:37:38 +0000 (15:37 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 11 Mar 2026 00:05:36 +0000 (01:05 +0100)
The generic v4l2_subdev_get_fmt() helper function can be utilized to
get the setup device format instead of the custom one.

Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/og01a1b.c

index c0ab230940f8300950481e79b7173ea37c44aabc..34d23413522d4d7950524cc1265950a22c9fb3ec 100644 (file)
@@ -701,21 +701,6 @@ static int og01a1b_set_format(struct v4l2_subdev *sd,
        return 0;
 }
 
-static int og01a1b_get_format(struct v4l2_subdev *sd,
-                             struct v4l2_subdev_state *sd_state,
-                             struct v4l2_subdev_format *fmt)
-{
-       struct og01a1b *og01a1b = to_og01a1b(sd);
-
-       if (fmt->which == V4L2_SUBDEV_FORMAT_TRY)
-               fmt->format = *v4l2_subdev_state_get_format(sd_state,
-                                                           fmt->pad);
-       else
-               og01a1b_update_pad_format(og01a1b->cur_mode, &fmt->format);
-
-       return 0;
-}
-
 static int og01a1b_enum_mbus_code(struct v4l2_subdev *sd,
                                  struct v4l2_subdev_state *sd_state,
                                  struct v4l2_subdev_mbus_code_enum *code)
@@ -771,7 +756,7 @@ static const struct v4l2_subdev_video_ops og01a1b_video_ops = {
 
 static const struct v4l2_subdev_pad_ops og01a1b_pad_ops = {
        .set_fmt = og01a1b_set_format,
-       .get_fmt = og01a1b_get_format,
+       .get_fmt = v4l2_subdev_get_fmt,
        .enum_mbus_code = og01a1b_enum_mbus_code,
        .enum_frame_size = og01a1b_enum_frame_size,
        .enable_streams = og01a1b_enable_streams,