All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Rui Miguel Silva <rmfrfs@gmail.com>,
	Paul Elder <paul.elder@ideasonboard.com>,
	Martin Kepplinger <martin.kepplinger@puri.sm>,
	Adam Ford <aford173@gmail.com>,
	kernel@pengutronix.de, linux-imx@nxp.com
Subject: [PATCH v1 5/6] media: imx: imx7-media-csi: Drop unneeded pad checks
Date: Fri, 27 Jan 2023 04:27:14 +0200	[thread overview]
Message-ID: <20230127022715.27234-6-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20230127022715.27234-1-laurent.pinchart@ideasonboard.com>

The subdev core guarantees that the .set_fmt() operation is always
called with a valid pad. Drop the unneeded pad checks.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/platform/nxp/imx7-media-csi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
index f02a88e1ca10..052acbd683a8 100644
--- a/drivers/media/platform/nxp/imx7-media-csi.c
+++ b/drivers/media/platform/nxp/imx7-media-csi.c
@@ -1934,6 +1934,7 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi,
 		sdformat->format.quantization = in_fmt->quantization;
 		sdformat->format.ycbcr_enc = in_fmt->ycbcr_enc;
 		break;
+
 	case IMX7_CSI_PAD_SINK:
 		*cc = imx7_csi_find_mbus_format(sdformat->format.code);
 		if (!*cc) {
@@ -1945,8 +1946,6 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi,
 		if (sdformat->format.field != V4L2_FIELD_INTERLACED)
 			sdformat->format.field = V4L2_FIELD_NONE;
 		break;
-	default:
-		return -EINVAL;
 	}
 
 	imx7_csi_try_colorimetry(&sdformat->format);
@@ -1966,9 +1965,6 @@ static int imx7_csi_set_fmt(struct v4l2_subdev *sd,
 	struct v4l2_subdev_format format;
 	int ret = 0;
 
-	if (sdformat->pad >= IMX7_CSI_PADS_NUM)
-		return -EINVAL;
-
 	mutex_lock(&csi->lock);
 
 	if (csi->is_streaming) {
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2023-01-27  2:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27  2:27 [PATCH v1 0/6] media: nxp: imx7-media-csi: Move to subdev active state Laurent Pinchart
2023-01-27  2:27 ` [PATCH v1 1/6] media: imx: imx7-media-csi: Drop imx7_csi.cc field Laurent Pinchart
2023-01-27  2:27 ` [PATCH v1 2/6] media: imx: imx7-media-csi: Simplify imx7_csi_video_init_format() Laurent Pinchart
2023-01-27  3:19   ` Adam Ford
2023-01-27  6:57     ` Laurent Pinchart
2023-01-27 11:07       ` Adam Ford
2023-01-27 11:20         ` Adam Ford
2023-01-29  2:36           ` Laurent Pinchart
2023-01-27  2:27 ` [PATCH v1 3/6] media: imx: imx7-media-csi: Drop unneeded check when starting streaming Laurent Pinchart
2023-01-27  2:27 ` [PATCH v1 4/6] media: imx: imx7-media-csi: Drop unneeded src_sd check Laurent Pinchart
2023-01-27  2:27 ` Laurent Pinchart [this message]
2023-01-27  2:27 ` [PATCH v1 6/6] media: imx: imx7-media-csi: Use V4L2 subdev active state Laurent Pinchart
2023-01-27  2:41 ` [PATCH v1 0/6] media: nxp: imx7-media-csi: Move to " Adam Ford
2023-01-27 11:41 ` Martin Kepplinger
2023-01-29  2:35   ` Laurent Pinchart

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=20230127022715.27234-6-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=aford173@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-media@vger.kernel.org \
    --cc=martin.kepplinger@puri.sm \
    --cc=paul.elder@ideasonboard.com \
    --cc=rmfrfs@gmail.com \
    /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.