media: atmel-isc: Use accessors for pad config 'try_*' fields
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 23 Oct 2023 21:40:07 +0000 (23:40 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 23 Nov 2023 17:23:01 +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/deprecated/atmel/atmel-isc-base.c

index 8e26663cecb63d32b696135d19bcfeebcb06dc1e..b63eea8f4fc0e9c99f55983ce0beabb69adb26ed 100644 (file)
@@ -820,6 +820,8 @@ static int isc_try_configure_pipeline(struct isc_device *isc)
 static void isc_try_fse(struct isc_device *isc,
                        struct v4l2_subdev_state *sd_state)
 {
+       struct v4l2_rect *try_crop =
+               v4l2_subdev_get_pad_crop(isc->current_subdev->sd, sd_state, 0);
        struct v4l2_subdev_frame_size_enum fse = {
                .which = V4L2_SUBDEV_FORMAT_TRY,
        };
@@ -841,11 +843,11 @@ static void isc_try_fse(struct isc_device *isc,
         * just use the maximum ISC can receive.
         */
        if (ret) {
-               sd_state->pads->try_crop.width = isc->max_width;
-               sd_state->pads->try_crop.height = isc->max_height;
+               try_crop->width = isc->max_width;
+               try_crop->height = isc->max_height;
        } else {
-               sd_state->pads->try_crop.width = fse.max_width;
-               sd_state->pads->try_crop.height = fse.max_height;
+               try_crop->width = fse.max_width;
+               try_crop->height = fse.max_height;
        }
 }