2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-22 20:23:57 +08:00

[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>
This commit is contained in:
Laurent Pinchart 2012-08-28 18:38:58 -03:00 committed by Mauro Carvalho Chehab
parent f0ed2ce840
commit 30ecb936cb

View File

@ -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) {