aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/uvc/uvc_ctrl.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-08-28 17:38:58 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-11-28 07:27:18 -0500
commit30ecb936cbcd83e3735625ac63e1b4466546f5fe (patch)
tree3dcfcf158a7e0e25a8637367323642a37db5ef38 /drivers/media/usb/uvc/uvc_ctrl.c
parentf0ed2ce840b3a59b587e8aa398538141a86e9588 (diff)
[media] 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> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/uvc/uvc_ctrl.c')
-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,
927 int ret; 927 int ret;
928 928
929 if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0) 929 if ((ctrl->info.flags & UVC_CTRL_FLAG_GET_CUR) == 0)
930 return -EINVAL; 930 return -EACCES;
931 931
932 if (!ctrl->loaded) { 932 if (!ctrl->loaded) {
933 ret = uvc_query_ctrl(chain->dev, UVC_GET_CUR, ctrl->entity->id, 933 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,
1435 if (ctrl == NULL) 1435 if (ctrl == NULL)
1436 return -ENOENT; 1436 return -ENOENT;
1437 if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR)) 1437 if (!(ctrl->info.flags & UVC_CTRL_FLAG_SET_CUR))
1438 return -EINVAL; 1438 return -EACCES;
1439 1439
1440 /* Clamp out of range values. */ 1440 /* Clamp out of range values. */
1441 switch (mapping->v4l2_type) { 1441 switch (mapping->v4l2_type) {