public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: hverkuil@xs4all.nl, Janusz Krzysztofik <jmkrzyszt@gmail.com>
Subject: [RESEND PATCH 1/1] v4l2-subdev: Try formats are only available if subdev API is enabled
Date: Fri, 31 May 2019 14:54:26 +0300	[thread overview]
Message-ID: <20190531115426.15697-1-sakari.ailus@linux.intel.com> (raw)

Return an error for which == V4L2_SUBDEV_FORMAT_TRY if
CONFIG_VIDEO_V4L2_SUBDEV_API is not enabled. This is because the try
formats are not available in that case. Do the check here so that drivers
don't need to.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Depends-on: ("media: v4l2-subdev: Verify v4l2_subdev_call() pad config argument")
---
 drivers/media/v4l2-core/v4l2-subdev.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 34219e489be27..88b4b9d7c41be 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -122,7 +122,10 @@ static int subdev_close(struct file *file)
 
 static inline int check_which(__u32 which)
 {
-	if (which != V4L2_SUBDEV_FORMAT_TRY &&
+	if (
+#ifdef CONFIG_VIDEO_V4L2_SUBDEV_API
+	    which != V4L2_SUBDEV_FORMAT_TRY &&
+#endif
 	    which != V4L2_SUBDEV_FORMAT_ACTIVE)
 		return -EINVAL;
 
-- 
2.11.0


             reply	other threads:[~2019-05-31 11:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 11:54 Sakari Ailus [this message]
2019-05-31 18:40 ` [RESEND PATCH 1/1] v4l2-subdev: Try formats are only available if subdev API is enabled Janusz Krzysztofik
2019-06-02 23:08   ` Sakari Ailus

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=20190531115426.15697-1-sakari.ailus@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jmkrzyszt@gmail.com \
    --cc=linux-media@vger.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