Commit 93a9d900 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: v4l2-device.h: add v4l2_device_supports_requests() helper

Add a simple helper function that tests if the driver supports
the request API.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 0ca0e844
...@@ -211,6 +211,17 @@ static inline void v4l2_subdev_notify(struct v4l2_subdev *sd, ...@@ -211,6 +211,17 @@ static inline void v4l2_subdev_notify(struct v4l2_subdev *sd,
sd->v4l2_dev->notify(sd, notification, arg); 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. */ /* Helper macros to iterate over all subdevs. */
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment