summaryrefslogtreecommitdiffstats
path: root/drivers/media/media-request.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-09-01 13:29:14 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-11 15:57:29 +0200
commit15cd442e79e2a60a725ee5501e4ffb537698c802 (patch)
tree3a4b0356ca704fe66095ffeca6b9dc9a4be8c512 /drivers/media/media-request.c
parentmedia: v4l2-ctrls: improve media_request_(un)lock_for_update (diff)
downloadlinux-15cd442e79e2a60a725ee5501e4ffb537698c802.tar.xz
linux-15cd442e79e2a60a725ee5501e4ffb537698c802.zip
media: media-request: EPERM -> EACCES/EBUSY
If requests are not supported by the driver, then return EACCES, not EPERM. If you attempt to mix queueing buffers directly and using requests, then EBUSY is returned instead of EPERM: once a specific queueing mode has been chosen the queue is 'busy' if you attempt the other mode (i.e. direct queueing vs via a request). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/media-request.c')
-rw-r--r--drivers/media/media-request.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/media-request.c b/drivers/media/media-request.c
index 414197645e09..4e9db1fed697 100644
--- a/drivers/media/media-request.c
+++ b/drivers/media/media-request.c
@@ -249,7 +249,7 @@ media_request_get_by_fd(struct media_device *mdev, int request_fd)
if (!mdev || !mdev->ops ||
!mdev->ops->req_validate || !mdev->ops->req_queue)
- return ERR_PTR(-EPERM);
+ return ERR_PTR(-EACCES);
filp = fget(request_fd);
if (!filp)
@@ -405,7 +405,7 @@ int media_request_object_bind(struct media_request *req,
int ret = -EBUSY;
if (WARN_ON(!ops->release))
- return -EPERM;
+ return -EACCES;
spin_lock_irqsave(&req->lock, flags);