[PATCH v2 04/12] drm: panel: replace dev_* with DRM_DEV_* equivalent in panel-simple

Aastha Gupta aastha.gupta4104 at gmail.com
Tue Oct 24 14:10:55 UTC 2017


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.gupta4104 at gmail.com>
---
 drivers/gpu/drm/panel/panel-simple.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 474fa75..07f8c21 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -111,8 +111,8 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
 		videomode_from_timing(dt, &vm);
 		mode = drm_mode_create(drm);
 		if (!mode) {
-			dev_err(drm->dev, "failed to add mode %ux%u\n",
-				dt->hactive.typ, dt->vactive.typ);
+			DRM_DEV_ERROR(drm->dev, "failed to add mode %ux%u\n",
+				      dt->hactive.typ, dt->vactive.typ);
 			continue;
 		}
 
@@ -132,8 +132,8 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
 
 		mode = drm_mode_duplicate(drm, m);
 		if (!mode) {
-			dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
-				m->hdisplay, m->vdisplay, m->vrefresh);
+			DRM_DEV_ERROR(drm->dev, "failed to add mode %ux%u@%u\n",
+				      m->hdisplay, m->vdisplay, m->vrefresh);
 			continue;
 		}
 
@@ -210,7 +210,7 @@ static int panel_simple_prepare(struct drm_panel *panel)
 
 	err = regulator_enable(p->supply);
 	if (err < 0) {
-		dev_err(panel->dev, "failed to enable supply: %d\n", err);
+		DRM_DEV_ERROR(panel->dev, "failed to enable supply: %d\n", err);
 		return err;
 	}
 
@@ -315,7 +315,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
 						     GPIOD_OUT_LOW);
 	if (IS_ERR(panel->enable_gpio)) {
 		err = PTR_ERR(panel->enable_gpio);
-		dev_err(dev, "failed to request GPIO: %d\n", err);
+		DRM_DEV_ERROR(dev, "failed to request GPIO: %d\n", err);
 		return err;
 	}
 
@@ -2378,7 +2378,8 @@ static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi)
 
 	err = mipi_dsi_detach(dsi);
 	if (err < 0)
-		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err);
+		DRM_DEV_ERROR(&dsi->dev,
+			      "failed to detach from DSI host: %d\n", err);
 
 	return panel_simple_remove(&dsi->dev);
 }
-- 
2.7.4



More information about the dri-devel mailing list