aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/usb/uvc
diff options
context:
space:
mode:
authorRicardo Ribalda <ribalda@chromium.org>2024-11-28 20:53:42 +0000
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2024-12-19 14:44:43 +0000
commit060950f7f74ef242ce9eec837a75a53b379959f0 (patch)
tree71c46d179c93a0c190d9d911fa4d514377f30402 /drivers/media/usb/uvc
parentmedia: uvcvideo: Support partial control reads (diff)
downloadwireguard-linux-060950f7f74ef242ce9eec837a75a53b379959f0.tar.xz
wireguard-linux-060950f7f74ef242ce9eec837a75a53b379959f0.zip
media: uvcvideo: Add more logging to uvc_query_ctrl()
If we fail to query the control error code there is no information on dmesg or in uvc_dbg. This makes difficult to debug the issue. Print a proper error message when we cannot retrieve the error code from the device. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Link: https://lore.kernel.org/r/20241128-uvc-readless-v5-2-cf16ed282af8@chromium.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc')
-rw-r--r--drivers/media/usb/uvc/uvc_video.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index d2fe01bcd209..a260e9868e8b 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -117,8 +117,12 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
error = *(u8 *)data;
*(u8 *)data = tmp;
- if (ret != 1)
+ if (ret != 1) {
+ dev_err_ratelimited(&dev->udev->dev,
+ "Failed to query (%s) UVC error code control %u on unit %u: %d (exp. 1).\n",
+ uvc_query_name(query), cs, unit, ret);
return ret < 0 ? ret : -EPIPE;
+ }
uvc_dbg(dev, CONTROL, "Control error %u\n", error);