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 <[email protected]> Signed-off-by: Ricardo Ribalda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent f00ee2c commit 060950f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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)