]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: v4l2-device.h: add v4l2_device_supports_requests() helper
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 23 May 2018 11:11:06 +0000 (07:11 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 31 Aug 2018 15:07:26 +0000 (11:07 -0400)
Add a simple helper function that tests if the driver supports
the request API.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
include/media/v4l2-device.h

index b330e4a08a6b805e6613dc626ae4e569d3b89b1f..ac7677a183ff2ffce02c5676bbc332ae57ab03dc 100644 (file)
@@ -211,6 +211,17 @@ static inline void v4l2_subdev_notify(struct v4l2_subdev *sd,
                sd->v4l2_dev->notify(sd, notification, arg);
 }
 
+/**
+ * v4l2_device_supports_requests - Test if requests are supported.
+ *
+ * @v4l2_dev: pointer to struct v4l2_device
+ */
+static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev)
+{
+       return v4l2_dev->mdev && v4l2_dev->mdev->ops &&
+              v4l2_dev->mdev->ops->req_queue;
+}
+
 /* Helper macros to iterate over all subdevs. */
 
 /**