This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: ov2680: Remove VIDEO_V4L2_SUBDEV_API ifdef-s
Author:  Hans de Goede <hdego...@redhat.com>
Date:    Thu Aug 3 11:33:19 2023 +0200

VIDEO_V4L2_SUBDEV_API is now automatically selected in Kconfig
for all sensor drivers. Remove the ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
checks.

This is a preparation patch for fixing ov2680_set_fmt()
which == V4L2_SUBDEV_FORMAT_TRY calls not properly filling in
the passed in v4l2_mbus_framefmt struct.

Fixes: 3ee47cad3e69 ("media: ov2680: Add Omnivision OV2680 sensor driver")
Reviewed-by: Daniel Scally <dan.sca...@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmf...@gmail.com>
Signed-off-by: Hans de Goede <hdego...@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mche...@kernel.org>

 drivers/media/i2c/ov2680.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

---

diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c
index 74024ba968b4..5c1f5dd4824a 100644
--- a/drivers/media/i2c/ov2680.c
+++ b/drivers/media/i2c/ov2680.c
@@ -562,7 +562,6 @@ static int ov2680_get_fmt(struct v4l2_subdev *sd,
 {
        struct ov2680_dev *sensor = to_ov2680_dev(sd);
        struct v4l2_mbus_framefmt *fmt = NULL;
-       int ret = 0;
 
        if (format->pad != 0)
                return -EINVAL;
@@ -570,22 +569,17 @@ static int ov2680_get_fmt(struct v4l2_subdev *sd,
        mutex_lock(&sensor->lock);
 
        if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
                fmt = v4l2_subdev_get_try_format(&sensor->sd, sd_state,
                                                 format->pad);
-#else
-               ret = -EINVAL;
-#endif
        } else {
                fmt = &sensor->fmt;
        }
 
-       if (fmt)
-               format->format = *fmt;
+       format->format = *fmt;
 
        mutex_unlock(&sensor->lock);
 
-       return ret;
+       return 0;
 }
 
 static int ov2680_set_fmt(struct v4l2_subdev *sd,
@@ -594,9 +588,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
 {
        struct ov2680_dev *sensor = to_ov2680_dev(sd);
        struct v4l2_mbus_framefmt *fmt = &format->format;
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
        struct v4l2_mbus_framefmt *try_fmt;
-#endif
        const struct ov2680_mode_info *mode;
        int ret = 0;
 
@@ -619,10 +611,8 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
        }
 
        if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
                try_fmt = v4l2_subdev_get_try_format(sd, sd_state, 0);
                format->format = *try_fmt;
-#endif
                goto unlock;
        }
 
@@ -780,9 +770,7 @@ static int ov2680_v4l2_register(struct ov2680_dev *sensor)
        v4l2_i2c_subdev_init(&sensor->sd, sensor->i2c_client,
                             &ov2680_subdev_ops);
 
-#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
        sensor->sd.flags = V4L2_SUBDEV_FL_HAS_DEVNODE;
-#endif
        sensor->pad.flags = MEDIA_PAD_FL_SOURCE;
        sensor->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
 

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to