All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH v2 6/9] media: atomisp: Use accessors for pad config 'try_*' fields
Date: Fri, 27 Oct 2023 12:16:46 +0300	[thread overview]
Message-ID: <20231027091649.10553-7-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20231027091649.10553-1-laurent.pinchart@ideasonboard.com>

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>
---
 drivers/staging/media/atomisp/i2c/atomisp-gc2235.c  | 2 +-
 drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 2 +-
 drivers/staging/media/atomisp/i2c/atomisp-ov2722.c  | 2 +-
 drivers/staging/media/atomisp/pci/atomisp_tpg.c     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
index 9fa390fbc5f3..5e438c5fd4a9 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
@@ -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;
 	}
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
index 1c6643c442ef..db76f52e1dc8 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
@@ -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;
 	}
 
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
index 6a72691ed5b7..ae70e04040dd 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
@@ -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;
 	}
 
diff --git a/drivers/staging/media/atomisp/pci/atomisp_tpg.c b/drivers/staging/media/atomisp/pci/atomisp_tpg.c
index 074826a5b706..b2376ebf45a1 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_tpg.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_tpg.c
@@ -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;
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2023-10-27  9:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  9:16 [PATCH v2 0/9] media: v4l2-subdev: Rename pad config 'try_*' fields Laurent Pinchart
2023-10-27  9:16 ` [PATCH v2 1/9] media: v4l2-subdev: Fix indentation in v4l2-subdev.h Laurent Pinchart
2023-10-27  9:16 ` [PATCH v2 2/9] media: v4l2-subdev: Drop outdated comment for v4l2_subdev_pad_config Laurent Pinchart
2023-10-27  9:16 ` [PATCH v2 3/9] media: microchip-isc: Remove dead code in pipeline validation Laurent Pinchart
2023-11-10 10:59   ` Eugen Hristev
2023-10-27  9:16 ` [PATCH v2 4/9] media: atmel-isi: Use accessors for pad config 'try_*' fields Laurent Pinchart
2023-10-27  9:16 ` [PATCH v2 5/9] media: atmel-isc: " Laurent Pinchart
2023-10-27  9:16 ` Laurent Pinchart [this message]
2023-10-27  9:16 ` [PATCH v2 7/9] media: tegra-video: " Laurent Pinchart
2023-10-27  9:16 ` [PATCH v2 8/9] media: i2c: " Laurent Pinchart
2023-10-27  9:16 ` [PATCH v2 9/9] media: v4l2-subdev: Rename " Laurent Pinchart
2023-10-30  6:32 [PATCH v2 6/9] media: atomisp: Use accessors for " kernel test robot
2023-10-31  1:51 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231027091649.10553-7-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.