linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/print: add DRM_DEV_WARN macro
@ 2019-11-14 13:25 Wambui Karuga
  2019-11-14 13:25 ` [PATCH 2/2] drm/rockchip: use DRM_DEV_WARN macro in debug output Wambui Karuga
  0 siblings, 1 reply; 2+ messages in thread
From: Wambui Karuga @ 2019-11-14 13:25 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, sean, airlied, daniel, hjc
  Cc: heiko, dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

Add the DRM_DEV_WARN helper macro for printing warnings
that use device pointers in their log output format.
DRM_DEV_WARN can replace the use of dev_warn in such cases.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 include/drm/drm_print.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 5b8049992c24..6ddf91c0cb29 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -329,6 +329,15 @@ void drm_err(const char *format, ...);
 #define DRM_WARN_ONCE(fmt, ...)						\
 	_DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__)
 
+/**
+ * Warning output.
+ *
+ * @dev: device pointer
+ * @fmt: printf() like format string.
+ */
+#define DRM_DEV_WARN(dev, fmt, ...)					\
+	drm_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
+
 /**
  * Error output.
  *
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] drm/rockchip: use DRM_DEV_WARN macro in debug output
  2019-11-14 13:25 [PATCH 1/2] drm/print: add DRM_DEV_WARN macro Wambui Karuga
@ 2019-11-14 13:25 ` Wambui Karuga
  0 siblings, 0 replies; 2+ messages in thread
From: Wambui Karuga @ 2019-11-14 13:25 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, sean, airlied, daniel, hjc
  Cc: heiko, dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

Replace the use of dev_warn in debug output with the new DRM specific
DRM_DEV_WARN debug output macro to maintain consistency across the driver.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
---
 drivers/gpu/drm/rockchip/inno_hdmi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
index e5864e823020..d7ee8d1835c4 100644
--- a/drivers/gpu/drm/rockchip/inno_hdmi.c
+++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
@@ -796,7 +796,8 @@ static struct i2c_adapter *inno_hdmi_i2c_adapter(struct inno_hdmi *hdmi)
 
 	ret = i2c_add_adapter(adap);
 	if (ret) {
-		dev_warn(hdmi->dev, "cannot add %s I2C adapter\n", adap->name);
+		DRM_DEV_WARN(hdmi->dev,
+			     "cannot add %s I2C adapter\n", adap->name);
 		devm_kfree(hdmi->dev, i2c);
 		return ERR_PTR(ret);
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-14 13:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 13:25 [PATCH 1/2] drm/print: add DRM_DEV_WARN macro Wambui Karuga
2019-11-14 13:25 ` [PATCH 2/2] drm/rockchip: use DRM_DEV_WARN macro in debug output Wambui Karuga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).