[media] uvcvideo: Return -EINVAL when setting a menu control to an invalid value

-ERANGE is the right error code when the value is outside of the menu
range, but -EINVAL must be reported for invalid values inside the range.

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 2013-01-11 10:22:39 -03:00 committed by Mauro Carvalho Chehab
parent 1e2e9086c7
commit b418697115
1 changed files with 1 additions and 1 deletions

View File

@ -1487,7 +1487,7 @@ int uvc_ctrl_set(struct uvc_video_chain *chain,
step = mapping->get(mapping, UVC_GET_RES,
uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES));
if (!(step & value))
return -ERANGE;
return -EINVAL;
}
break;