aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-08-28 23:38:58 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-10-20 22:14:15 +0200
commit02207ada5ca3048b1a62c4fdff4aaa58fa40a793 (patch)
treee72cd4b7b6be58163cb7bdbba46d54db23d05860
parent20c809246a5d2dce876e2708c7044efd470e7866 (diff)
uvcvideo: Return -EACCES when trying to access a read/write-only control
The proper return code according to the V4L2 specification is -EACCES, not -EINVAL. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--drivers/media/usb/uvc/uvc_ctrl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 7879d306f1fc..3e0b66efc9ba 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -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,
@@ -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) {

Privacy Policy