Skip to content

Commit 060950f

Browse files
ribaldamchehab
authored andcommitted
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>
1 parent f00ee2c commit 060950f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/media/usb/uvc/uvc_video.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,12 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
117117
error = *(u8 *)data;
118118
*(u8 *)data = tmp;
119119

120-
if (ret != 1)
120+
if (ret != 1) {
121+
dev_err_ratelimited(&dev->udev->dev,
122+
"Failed to query (%s) UVC error code control %u on unit %u: %d (exp. 1).\n",
123+
uvc_query_name(query), cs, unit, ret);
121124
return ret < 0 ? ret : -EPIPE;
125+
}
122126

123127
uvc_dbg(dev, CONTROL, "Control error %u\n", error);
124128

0 commit comments

Comments
 (0)