diff options
author | Ricardo Ribalda <ribalda@chromium.org> | 2020-12-23 14:35:26 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-01-27 15:07:27 +0100 |
commit | ed4c5fa4d804f57fa820d8ef8d3054be2ed13bea (patch) | |
tree | 3c3c6ed9171be2df8b108c3621fe4a155d685c55 /drivers/media/usb/uvc/uvcvideo.h | |
parent | media: uvcvideo: New macro uvc_trace_cont (diff) | |
download | linux-ed4c5fa4d804f57fa820d8ef8d3054be2ed13bea.tar.xz linux-ed4c5fa4d804f57fa820d8ef8d3054be2ed13bea.zip |
media: uvcvideo: use dev_printk() for uvc_trace()
Instead of calling prink() inside uvc_trace, use dev_printk(), which adds
context to the output.
Now that we are at it, regroup the strings so the messages can be easily
"grepable".
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc/uvcvideo.h')
-rw-r--r-- | drivers/media/usb/uvc/uvcvideo.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index 6687949d93d9..34c1e8a024ac 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -752,10 +752,11 @@ extern unsigned int uvc_trace_param; extern unsigned int uvc_timeout_param; extern unsigned int uvc_hw_timestamps_param; -#define uvc_trace(flag, fmt, ...) \ +#define uvc_trace(_dev, flag, fmt, ...) \ do { \ if (uvc_trace_param & flag) \ - printk(KERN_DEBUG "uvcvideo: " fmt, ##__VA_ARGS__); \ + dev_printk(KERN_DEBUG, &(_dev)->udev->dev, fmt, \ + ##__VA_ARGS__); \ } while (0) #define uvc_trace_cont(flag, fmt, ...) \ @@ -817,6 +818,12 @@ static inline int uvc_queue_streaming(struct uvc_video_queue *queue) return vb2_is_streaming(&queue->queue); } +static inline struct uvc_streaming * +uvc_queue_to_stream(struct uvc_video_queue *queue) +{ + return container_of(queue, struct uvc_streaming, queue); +} + /* V4L2 interface */ extern const struct v4l2_ioctl_ops uvc_ioctl_ops; extern const struct v4l2_file_operations uvc_fops; |