From: Laurent Pinchart Date: Fri, 11 Jan 2013 13:22:39 +0000 (-0300) Subject: [media] uvcvideo: Return -EINVAL when setting a menu control to an invalid value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b41869711586b047c18435ba84baf334918bae01;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [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 Acked-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c index 61e28dec991d..a2f4501c23ca 100644 --- a/drivers/media/usb/uvc/uvc_ctrl.c +++ b/drivers/media/usb/uvc/uvc_ctrl.c @@ -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;