diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-03-20 15:31:18 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-25 18:26:10 +0100 |
commit | e79c7159d471fa5e818bf9ec13e095e22033c792 (patch) | |
tree | 344ececbb149b53b0ebb24d4149a26a247440c58 /drivers/media/media-request.c | |
parent | media: cedrus: set requires_requests (diff) | |
download | linux-e79c7159d471fa5e818bf9ec13e095e22033c792.tar.xz linux-e79c7159d471fa5e818bf9ec13e095e22033c792.zip |
media: media requests: return EBADR instead of EACCES
If requests are used when they shouldn't, or not used when they should,
then return EBADR (Invalid request descriptor) instead of EACCES.
The reason for this change is that EACCES has more to do with permissions
(not being the owner of the resource), but in this case the request file
descriptor is just wrong for the current mode of the device.
Update the documentation accordingly.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/media-request.c b/drivers/media/media-request.c index eec2e2b2f6ec..ed87305b29f9 100644 --- a/drivers/media/media-request.c +++ b/drivers/media/media-request.c @@ -251,7 +251,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(-EACCES); + return ERR_PTR(-EBADR); filp = fget(request_fd); if (!filp) @@ -407,7 +407,7 @@ int media_request_object_bind(struct media_request *req, int ret = -EBUSY; if (WARN_ON(!ops->release)) - return -EACCES; + return -EBADR; spin_lock_irqsave(&req->lock, flags); |