All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Cowan <ian@linux.cowan.aero>
To: clabbe@baylibre.com
Cc: mchehab@kernel.org, gregkh@linuxfoundation.org,
	dan.carpenter@oracle.com, mjpeg-users@lists.sourceforge.net,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	ian@linux.cowan.aero
Subject: [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros
Date: Sat, 23 Apr 2022 01:17:45 -0400	[thread overview]
Message-ID: <20220423051745.292683-1-ian@linux.cowan.aero> (raw)

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 --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);
-- 
2.35.1


             reply	other threads:[~2022-04-23  5:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23  5:17 Ian Cowan [this message]
2022-04-24 19:17 ` [PATCH 1/4] staging: media: zoran: add zrdev_dbg() macros LABBE Corentin
2022-04-25  1:22   ` Ian Cowan
2022-04-25  4:45     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220423051745.292683-1-ian@linux.cowan.aero \
    --to=ian@linux.cowan.aero \
    --cc=clabbe@baylibre.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mjpeg-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.