summaryrefslogtreecommitdiffstats
path: root/include/media/media-request.h
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-05-21 10:54:28 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-08-31 17:06:24 +0200
commitbe9d6d4b0bf9cc3644826fb95264dbddb9a6d047 (patch)
treef064a8189514f438514e118b6c22c1bcfd6aee56 /include/media/media-request.h
parentmedia: doc: Add media-request.h header to documentation build (diff)
downloadlinux-be9d6d4b0bf9cc3644826fb95264dbddb9a6d047.tar.xz
linux-be9d6d4b0bf9cc3644826fb95264dbddb9a6d047.zip
media: media-request: add media_request_get_by_fd
Add media_request_get_by_fd() to find a request based on the file descriptor. The caller has to call media_request_put() for the returned request since this function increments the refcount. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to '')
-rw-r--r--include/media/media-request.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/media/media-request.h b/include/media/media-request.h
index 9664ebac5dc4..1c3e5d804d07 100644
--- a/include/media/media-request.h
+++ b/include/media/media-request.h
@@ -144,6 +144,24 @@ static inline void media_request_get(struct media_request *req)
void media_request_put(struct media_request *req);
/**
+ * media_request_get_by_fd - Get a media request by fd
+ *
+ * @mdev: Media device this request belongs to
+ * @request_fd: The file descriptor of the request
+ *
+ * Get the request represented by @request_fd that is owned
+ * by the media device.
+ *
+ * Return a -EPERM error pointer if requests are not supported
+ * by this driver. Return -ENOENT if the request was not found.
+ * Return the pointer to the request if found: the caller will
+ * have to call @media_request_put when it finished using the
+ * request.
+ */
+struct media_request *
+media_request_get_by_fd(struct media_device *mdev, int request_fd);
+
+/**
* media_request_alloc - Allocate the media request
*
* @mdev: Media device this request belongs to
@@ -164,6 +182,12 @@ static inline void media_request_put(struct media_request *req)
{
}
+static inline struct media_request *
+media_request_get_by_fd(struct media_device *mdev, int request_fd)
+{
+ return ERR_PTR(-EPERM);
+}
+
#endif
/**