For drivers which could have multiple instances, it is necessary to
differentiate between which is which in the logs. Since
DRM_INFO/WARN/ERROR don’t do this, drivers used dev_info/warn/err to
make this differentiation. We now have DRM_DEV_* variants of the drm
print macros, so we can start to convert those drivers back to using
drm-formatted specific log messages.

This patch is using following Coccinelle script:
@@
@@

(
- dev_info
+ DRM_DEV_INFO
|
- dev_err
+ DRM_DEV_ERROR
|
- dev_dbg
+ DRM_DEV_DEBUG
)

Signed-off-by: Aastha Gupta <aastha.gupta4...@gmail.com>
---
 drivers/gpu/drm/panel/panel-samsung-ld9040.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-samsung-ld9040.c 
b/drivers/gpu/drm/panel/panel-samsung-ld9040.c
index 3cf4cf6..a36c2ff 100644
--- a/drivers/gpu/drm/panel/panel-samsung-ld9040.c
+++ b/drivers/gpu/drm/panel/panel-samsung-ld9040.c
@@ -145,7 +145,7 @@ static void ld9040_dcs_write(struct ld9040 *ctx, const u8 
*data, size_t len)
        if (ctx->error < 0 || len == 0)
                return;
 
-       dev_dbg(ctx->dev, "writing dcs seq: %*ph\n", (int)len, data);
+       DRM_DEV_DEBUG(ctx->dev, "writing dcs seq: %*ph\n", (int)len, data);
        ret = ld9040_spi_write_word(ctx, *data);
 
        while (!ret && --len) {
@@ -154,8 +154,8 @@ static void ld9040_dcs_write(struct ld9040 *ctx, const u8 
*data, size_t len)
        }
 
        if (ret) {
-               dev_err(ctx->dev, "error %d writing dcs seq: %*ph\n", ret,
-                       (int)len, data);
+               DRM_DEV_ERROR(ctx->dev, "error %d writing dcs seq: %*ph\n", ret,
+                             (int)len, data);
                ctx->error = ret;
        }
 
@@ -338,15 +338,15 @@ static int ld9040_probe(struct spi_device *spi)
 
        ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
        if (IS_ERR(ctx->reset_gpio)) {
-               dev_err(dev, "cannot get reset-gpios %ld\n",
-                       PTR_ERR(ctx->reset_gpio));
+               DRM_DEV_ERROR(dev, "cannot get reset-gpios %ld\n",
+                             PTR_ERR(ctx->reset_gpio));
                return PTR_ERR(ctx->reset_gpio);
        }
 
        spi->bits_per_word = 9;
        ret = spi_setup(spi);
        if (ret < 0) {
-               dev_err(dev, "spi setup failed.\n");
+               DRM_DEV_ERROR(dev, "spi setup failed.\n");
                return ret;
        }
 
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to