From: Rui Miguel Silva <rmfrfs@gmail.com>
To: Alexander Stein <alexander.stein@ew.tq-group.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
NXP Linux Team <linux-imx@nxp.com>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>,
linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] media: imx: imx7-media-csi: Fail for non video-capture formats
Date: Fri, 17 Mar 2023 17:23:29 +0000 [thread overview]
Message-ID: <m3o7or47hq.fsf@gmail.com> (raw)
In-Reply-To: <20230316143829.499039-4-alexander.stein@ew.tq-group.com>
Hi Alexander,
thanks for the patch.
Alexander Stein <alexander.stein@ew.tq-group.com> writes:
> This driver only support V4L2_BUF_TYPE_VIDEO_CAPTURE, so fail for other
> passed types.
>
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
> drivers/media/platform/nxp/imx7-media-csi.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c
> index 389d7d88b341..e470b0505d3b 100644
> --- a/drivers/media/platform/nxp/imx7-media-csi.c
> +++ b/drivers/media/platform/nxp/imx7-media-csi.c
> @@ -1186,6 +1186,11 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt,
> static int imx7_csi_video_try_fmt_vid_cap(struct file *file, void *fh,
> struct v4l2_format *f)
> {
> + struct imx7_csi *csi = video_drvdata(file);
Maybe copy/paste problem csi is never used.
> +
> + if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
> + return -EINVAL;
Is this function ever called if f->type is not TYPE_VIDEO_CAPTURE?
> +
> __imx7_csi_video_try_fmt(&f->fmt.pix, NULL);
> return 0;
> }
> @@ -1196,6 +1201,9 @@ static int imx7_csi_video_s_fmt_vid_cap(struct file *file, void *fh,
> struct imx7_csi *csi = video_drvdata(file);
> const struct imx7_csi_pixfmt *cc;
>
> + if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
> + return -EINVAL;
Ditto?
Cheers,
Rui
> +
> if (vb2_is_busy(&csi->q)) {
> dev_err(csi->dev, "%s queue busy\n", __func__);
> return -EBUSY;
> --
> 2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-03-17 17:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 14:38 [PATCH 0/3] imx7-media-csi: small cleanup Alexander Stein
2023-03-16 14:38 ` [PATCH 1/3] media: imx: imx7-media-csi: Fix mbus framefmt field init Alexander Stein
2023-03-17 17:20 ` Rui Miguel Silva
2023-03-17 18:28 ` Laurent Pinchart
2023-03-17 19:20 ` Rui Miguel Silva
2023-03-16 14:38 ` [PATCH 2/3] media: imx: imx7-media-csi: Fail on invalid type in VIDIOC_G_SELECTION Alexander Stein
2023-03-17 18:32 ` Laurent Pinchart
2023-03-17 19:21 ` Rui Miguel Silva
2023-03-16 14:38 ` [PATCH 3/3] media: imx: imx7-media-csi: Fail for non video-capture formats Alexander Stein
2023-03-17 17:23 ` Rui Miguel Silva [this message]
2023-03-17 17:57 ` Laurent Pinchart
2023-03-21 7:18 ` Alexander Stein
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=m3o7or47hq.fsf@gmail.com \
--to=rmfrfs@gmail.com \
--cc=alexander.stein@ew.tq-group.com \
--cc=festevam@gmail.com \
--cc=kernel@pengutronix.de \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).