Skip to content

Commit

Permalink
[media] uvcvideo: Return -EACCES when trying to access a read/write-o…
Browse files Browse the repository at this point in the history
…nly control

The proper return code according to the V4L2 specification is -EACCES,
not -EINVAL.

Signed-off-by: Laurent Pinchart <[email protected]>
Acked-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pinchartl authored and Mauro Carvalho Chehab committed Nov 28, 2012
1 parent f0ed2ce commit 30ecb93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/media/usb/uvc/uvc_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ static int __uvc_ctrl_get(struct uvc_video_chain *chain,
int ret;

if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0)
return -EINVAL;
return -EACCES;

if (!ctrl->loaded) {
ret = uvc_query_ctrl(chain->dev, UVC_GET_CUR, ctrl->entity->id,
Expand Down Expand Up @@ -1435,7 +1435,7 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
if (ctrl == NULL)
return -ENOENT;
if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR))
return -EINVAL;
return -EACCES;

/* Clamp out of range values. */
switch (mapping->v4l2_type) {
Expand Down

0 comments on commit 30ecb93

Please sign in to comment.