[PATCH v1 10/19] drm/panel: lg: use DRM_DEV*

Sam Ravnborg sam at ravnborg.org
Thu Jan 31 19:26:10 UTC 2019


Introduce use of DRM_DEV* for logging.
This makes logging in the drm subsystem more consistent.

Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
Cc: Thierry Reding <thierry.reding at gmail.com>
Cc: David Airlie <airlied at linux.ie>
Cc: Daniel Vetter <daniel at ffwll.ch>
---
 drivers/gpu/drm/panel/panel-lg-lg4573.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lg-lg4573.c b/drivers/gpu/drm/panel/panel-lg-lg4573.c
index e63fba2761f4..9bbf6dde6b7d 100644
--- a/drivers/gpu/drm/panel/panel-lg-lg4573.c
+++ b/drivers/gpu/drm/panel/panel-lg-lg4573.c
@@ -18,6 +18,7 @@
 #include <drm/drm_device.h>
 #include <drm/drm_modes.h>
 #include <drm/drm_panel.h>
+#include <drm/drm_print.h>
 
 #include <linux/delay.h>
 #include <linux/gpio/consumer.h>
@@ -48,7 +49,7 @@ static int lg4573_spi_write_u16(struct lg4573 *ctx, u16 data)
 	u16 temp = cpu_to_be16(data);
 	struct spi_message msg;
 
-	dev_dbg(ctx->panel.dev, "writing data: %x\n", data);
+	DRM_DEV_DEBUG(ctx->panel.dev, "writing data: %x\n", data);
 	xfer.tx_buf = &temp;
 	spi_message_init(&msg);
 	spi_message_add_tail(&xfer, &msg);
@@ -115,7 +116,7 @@ static int lg4573_display_mode_settings(struct lg4573 *ctx)
 		0x7206, 0x720C, 0x7200, 0x7200,
 	};
 
-	dev_dbg(ctx->panel.dev, "transfer display mode settings\n");
+	DRM_DEV_DEBUG(ctx->panel.dev, "transfer display mode settings\n");
 	return lg4573_spi_write_u16_array(ctx, display_mode_settings,
 					  ARRAY_SIZE(display_mode_settings));
 }
@@ -131,7 +132,7 @@ static int lg4573_power_settings(struct lg4573 *ctx)
 		0x7263,
 	};
 
-	dev_dbg(ctx->panel.dev, "transfer power settings\n");
+	DRM_DEV_DEBUG(ctx->panel.dev, "transfer power settings\n");
 	return lg4573_spi_write_u16_array(ctx, power_settings,
 					  ARRAY_SIZE(power_settings));
 }
@@ -156,7 +157,7 @@ static int lg4573_gamma_settings(struct lg4573 *ctx)
 		0x7201, 0x7220, 0x7200, 0x7203,
 	};
 
-	dev_dbg(ctx->panel.dev, "transfer gamma settings\n");
+	DRM_DEV_DEBUG(ctx->panel.dev, "transfer gamma settings\n");
 	return lg4573_spi_write_u16_array(ctx, gamma_settings,
 					  ARRAY_SIZE(gamma_settings));
 }
@@ -165,7 +166,7 @@ static int lg4573_init(struct lg4573 *ctx)
 {
 	int ret;
 
-	dev_dbg(ctx->panel.dev, "initializing LCD\n");
+	DRM_DEV_DEBUG(ctx->panel.dev, "initializing LCD\n");
 
 	ret = lg4573_display_mode_settings(ctx);
 	if (ret)
@@ -219,9 +220,10 @@ static int lg4573_get_modes(struct drm_panel *panel)
 
 	mode = drm_mode_duplicate(panel->drm, &default_mode);
 	if (!mode) {
-		dev_err(panel->drm->dev, "failed to add mode %ux%ux@%u\n",
-			default_mode.hdisplay, default_mode.vdisplay,
-			default_mode.vrefresh);
+		DRM_DEV_ERROR(panel->drm->dev,
+			      "failed to add mode %ux%ux@%u\n",
+			      default_mode.hdisplay, default_mode.vdisplay,
+			      default_mode.vrefresh);
 		return -ENOMEM;
 	}
 
@@ -258,7 +260,7 @@ static int lg4573_probe(struct spi_device *spi)
 
 	ret = spi_setup(spi);
 	if (ret < 0) {
-		dev_err(&spi->dev, "SPI setup failed: %d\n", ret);
+		DRM_DEV_ERROR(&spi->dev, "SPI setup failed: %d\n", ret);
 		return ret;
 	}
 
-- 
2.12.0



More information about the dri-devel mailing list