]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: atomisp: gc0310: Use v4l2_subdev_get_fmt() as v4l2_subdev_pad_ops.get_fmt()
authorHans de Goede <hansg@kernel.org>
Sat, 17 May 2025 11:41:00 +0000 (13:41 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 8 Jul 2025 06:43:31 +0000 (08:43 +0200)
Now that the sd-state's fmt is properly initialized by
internal_ops.init_state(), the driver can be safely switched
to v4l2_subdev_get_fmt().

Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250517114106.43494-18-hansg@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/atomisp/i2c/atomisp-gc0310.c

index e0a031574a84f1cbe33b50a160e7e8240c065ada..f4b302d5eead6562476e658dd54da46da00cc38d 100644 (file)
@@ -390,18 +390,6 @@ static int gc0310_set_fmt(struct v4l2_subdev *sd,
        return 0;
 }
 
-static int gc0310_get_fmt(struct v4l2_subdev *sd,
-                         struct v4l2_subdev_state *sd_state,
-                         struct v4l2_subdev_format *format)
-{
-       struct gc0310_device *sensor = to_gc0310_sensor(sd);
-       struct v4l2_mbus_framefmt *fmt;
-
-       fmt = gc0310_get_pad_format(sensor, sd_state, format->pad, format->which);
-       format->format = *fmt;
-       return 0;
-}
-
 static int gc0310_get_selection(struct v4l2_subdev *sd,
                                struct v4l2_subdev_state *state,
                                struct v4l2_subdev_selection *sel)
@@ -581,7 +569,7 @@ static const struct v4l2_subdev_video_ops gc0310_video_ops = {
 static const struct v4l2_subdev_pad_ops gc0310_pad_ops = {
        .enum_mbus_code = gc0310_enum_mbus_code,
        .enum_frame_size = gc0310_enum_frame_size,
-       .get_fmt = gc0310_get_fmt,
+       .get_fmt = v4l2_subdev_get_fmt,
        .set_fmt = gc0310_set_fmt,
        .get_selection = gc0310_get_selection,
        .set_selection = gc0310_get_selection,