media: atomisp: Use accessors for pad config 'try_*' fields
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 23 Oct 2023 21:40:08 +0000 (23:40 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 23 Nov 2023 17:23:14 +0000 (18:23 +0100)
The 'try_*' fields of the v4l2_subdev_pad_config structure are meant to
be accessed through helper functions. Replace direct access with usage
of the v4l2_subdev_get_pad_format(), v4l2_subdev_get_pad_crop() and
v4l2_subdev_get_pad_compose() helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
drivers/staging/media/atomisp/pci/atomisp_tpg.c

index 9fa390fbc5f31e3c3b28dc266261a9a68d736cef..5e438c5fd4a92e230063cce5f2c5447bb9b4ebbc 100644 (file)
@@ -561,7 +561,7 @@ static int gc2235_set_fmt(struct v4l2_subdev *sd,
 
        fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
        if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-               sd_state->pads->try_fmt = *fmt;
+               *v4l2_subdev_get_pad_format(sd, sd_state, 0) = *fmt;
                mutex_unlock(&dev->input_lock);
                return 0;
        }
index 1c6643c442ef3607c781c6224101ce0162c522bf..db76f52e1dc8e4055f5750fdd2aa47a6f1095b95 100644 (file)
@@ -666,7 +666,7 @@ static int mt9m114_set_fmt(struct v4l2_subdev *sd,
        fmt->height = res->height;
 
        if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-               sd_state->pads->try_fmt = *fmt;
+               *v4l2_subdev_get_pad_format(sd, sd_state, 0) = *fmt;
                return 0;
        }
 
index 6a72691ed5b74dc1b4cfd2c20291bb9a28c8b137..ae70e04040dd6993afdf9534cee403968d7f2255 100644 (file)
@@ -671,7 +671,7 @@ static int ov2722_set_fmt(struct v4l2_subdev *sd,
 
        fmt->code = MEDIA_BUS_FMT_SGRBG10_1X10;
        if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-               sd_state->pads->try_fmt = *fmt;
+               *v4l2_subdev_get_pad_format(sd, sd_state, 0) = *fmt;
                return 0;
        }
 
index 074826a5b70643e39e712ee331f9d6480fe33454..b2376ebf45a1661e679a900510316b405011e3bb 100644 (file)
@@ -47,7 +47,7 @@ static int tpg_set_fmt(struct v4l2_subdev *sd,
        /* only raw8 grbg is supported by TPG */
        fmt->code = MEDIA_BUS_FMT_SGRBG8_1X8;
        if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-               sd_state->pads->try_fmt = *fmt;
+               *v4l2_subdev_get_pad_format(sd, sd_state, 0) = *fmt;
                return 0;
        }
        return 0;