summaryrefslogtreecommitdiff
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2023-01-03 17:36:21 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-01-16 00:45:12 +0300
commit44cdba4130ecdb59ff94c617b6cd8dc22b4f3c97 (patch)
tree4a35502d4895652b53085752886edf554de685bd /drivers/media/usb
parent67a655be5748426a9bda7845fc264ccf71a76ea3 (diff)
downloadlinux-44cdba4130ecdb59ff94c617b6cd8dc22b4f3c97.tar.xz
media: uvcvideo: Return -EACCES for Wrong state error
Error 2 is defined by UVC as: Wrong State: The device is in a state that disallows the specific request. The device will remain in this state until a specific action from the host or the user is completed. This is documented as happening when attempting to set the value of a manual control when the device is in auto mode. While V4L2 allows this, the closest error code defined by VIDIOC_S_CTRL is EACCES: EACCES: Attempt to set a read-only control or to get a write-only control. Or if there is an attempt to set an inactive control and the driver is not capable of caching the new value until the control is active again. Replace EILSEQ with EACCES. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Suggested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/uvc/uvc_video.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index f35674fb8912..3d3753a4c1f8 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -108,7 +108,7 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
case 1: /* Not ready */
return -EBUSY;
case 2: /* Wrong state */
- return -EILSEQ;
+ return -EACCES;
case 3: /* Power */
return -EREMOTE;
case 4: /* Out of range */