From 9748ecc4cfe9907df96b854a35530977d69007c4 Mon Sep 17 00:00:00 2001 From: Ricardo Ribalda Date: Mon, 28 Sep 2026 14:32:01 +0000 Subject: [PATCH] media: uvcvideo: Use uvc_warn_once when it make sense If there are multiple cameras in the system affected by a compliance error now we only show an error message for one of them. Use uvc_warn_once() to print an error message per device. Reviewed-by: Laurent Pinchart Reviewed-by: Hans de Goede Signed-off-by: Ricardo Ribalda Link: https://patch.msgid.link/20260928-uvc-version-v4-2-da0e983fcb95@chromium.org Signed-off-by: Hans de Goede Signed-off-by: Laurent Pinchart Signed-off-by: Hans Verkuil --- drivers/media/usb/uvc/uvc_video.c | 2 +- drivers/media/usb/uvc/uvcvideo.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 0167f0f8e846..a92a986ab714 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -95,7 +95,7 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit, */ if (ret > 0 && query != UVC_GET_INFO) { memset(data + ret, 0, size - ret); - dev_warn_once(&dev->intf->dev, + uvc_warn_once(dev, UVC_WARN_QUERY_CTRL, "UVC non compliance: %s control %u on unit %u returned %d bytes when we expected %u.\n", uvc_query_name(query), cs, unit, ret, size); return 0; diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index 45cce791c56d..af8cef94ffff 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -660,6 +660,7 @@ static inline struct uvc_fh *to_uvc_fh(struct file *filp) #define UVC_WARN_MINMAX 0 #define UVC_WARN_PROBE_DEF 1 #define UVC_WARN_XU_GET_RES 2 +#define UVC_WARN_QUERY_CTRL 3 extern unsigned int uvc_clock_param; extern unsigned int uvc_no_drop_param; -- knotmirror 0.0.1