Thread (19 messages) 19 messages, 3 authors, 2021-01-27

Re: [PATCH v7 08/12] media: uvcvideo: Use dev_ printk aliases

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: 2020-12-24 13:51:38
Also in: lkml

Hi Andy,

On Thu, Dec 24, 2020 at 02:59:34PM +0200, Andy Shevchenko wrote:
On Wed, Dec 23, 2020 at 3:39 PM Ricardo Ribalda wrote:
quoted
Replace all the uses of printk() and uvc_printk() with its
equivalent dev_ alias macros.
quoted
Modify uvc_warn_once() macro to use dev_info instead printk().
...
quoted
+#define uvc_warn_once(_dev, warn, fmt, ...)                            \
+do {                                                                   \
+       if (!test_and_set_bit(warn, &(_dev)->warnings))                 \
+               dev_info(&(_dev)->udev->dev, fmt, ##__VA_ARGS__);       \
+} while (0)
...

Why not to use dev_warn_once() instead?
uvc_warn_once() prints the warning once per device, not once globally.

-- 
Regards,

Laurent Pinchart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help