aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <[email protected]>2023-01-03 15:36:20 +0100
committerLaurent Pinchart <[email protected]>2023-01-15 23:45:11 +0200
commit67a655be5748426a9bda7845fc264ccf71a76ea3 (patch)
tree6340da33d0f78c0350f42da314d3520d94ad06f6
parent9f582f0418ed1c18f92c9e4628075d6ec9a7d9fb (diff)
media: uvcvideo: Improve error logging in uvc_query_ctrl()
Standard use of the driver may result in error messages on the kernel log. This can hide other more important messages, and alert unnecessarily the user. Let's keep dev_err() for the important occasions. If __uvc_query_ctrl() failed with a non -EPIPE error, then report that with dev_err. If an error code is obtained, then report that with dev_dbg. Reviewed-by: Ricardo Ribalda <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]>
-rw-r--r--drivers/media/usb/uvc/uvc_video.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 503ef29211ca..f35674fb8912 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -79,13 +79,14 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit,
if (likely(ret == size))
return 0;
- dev_err(&dev->udev->dev,
- "Failed to query (%s) UVC control %u on unit %u: %d (exp. %u).\n",
- uvc_query_name(query), cs, unit, ret, size);
-
- if (ret != -EPIPE)
+ if (ret != -EPIPE) {
+ dev_err(&dev->udev->dev,
+ "Failed to query (%s) UVC control %u on unit %u: %d (exp. %u).\n",
+ uvc_query_name(query), cs, unit, ret, size);
return ret;
+ }
+ /* Reuse data[0] to request the error code. */
tmp = *(u8 *)data;
ret = __uvc_query_ctrl(dev, UVC_GET_CUR, 0, intfnum,