diff mbox series

[1/4] staging: media: zoran: add zrdev_dbg() macros

Message ID 20220423051745.292683-1-ian@linux.cowan.aero
State New
Headers show
Series [1/4] staging: media: zoran: add zrdev_dbg() macros | expand

Commit Message

Ian Cowan April 23, 2022, 5:17 a.m. UTC
This adds the zrdev_dbg() (pointing to dev_dbg()), zrdev_err() (pointing
to dev_err()), and zrdev_info() (pointing to dev_info()) macros to the
zoran drivers. These are the preferred method for debugging and this
will allow to extract the device from the zoran struct to make the call.

Signed-off-by: Ian Cowan <ian@linux.cowan.aero>
---
 drivers/staging/media/zoran/zoran.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/drivers/staging/media/zoran/zoran.h b/drivers/staging/media/zoran/zoran.h
index 654c95fa5aba..42b86356c022 100644
--- a/drivers/staging/media/zoran/zoran.h
+++ b/drivers/staging/media/zoran/zoran.h
@@ -19,6 +19,7 @@ 
 #define _BUZ_H_
 
 #include <linux/debugfs.h>
+#include <linux/dev_printk.h>
 #include <media/v4l2-device.h>
 #include <media/v4l2-ctrls.h>
 #include <media/videobuf2-core.h>
@@ -301,6 +302,18 @@  static inline struct zoran *to_zoran(struct v4l2_device *v4l2_dev)
 
 #endif
 
+/**
+ * Debugging macros
+ */
+#define zrdev_dbg(zr, format, args...) \
+	dev_dbg(&zr->video_dev->dev, format, ##args) \
+
+#define zrdev_err(zr, format, args...) \
+	dev_err(&zr->video_dev->dev, format, ##args) \
+
+#define zrdev_info(zr, format, args...) \
+	dev_info(&zr->video_dev->dev, format, ##args) \
+
 int zoran_queue_init(struct zoran *zr, struct vb2_queue *vq, int dir);
 void zoran_queue_exit(struct zoran *zr);
 int zr_set_buf(struct zoran *zr);