[PATCH v2 11/12] drm: panel: replace dev_* with DRM_DEV_* equivalent in panel-sharp-ls043t1le01

Aastha Gupta aastha.gupta4104 at gmail.com
Tue Oct 24 14:11:02 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-sharp-ls043t1le01.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
index 3aeb0bd..e6ed6e7 100644
--- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
+++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
@@ -137,7 +137,7 @@ static int sharp_nt_panel_unprepare(struct drm_panel *panel)
 
 	ret = sharp_nt_panel_off(sharp_nt);
 	if (ret < 0) {
-		dev_err(panel->dev, "failed to set panel off: %d\n", ret);
+		DRM_DEV_ERROR(panel->dev, "failed to set panel off: %d\n", ret);
 		return ret;
 	}
 
@@ -175,13 +175,13 @@ static int sharp_nt_panel_prepare(struct drm_panel *panel)
 
 	ret = sharp_nt_panel_init(sharp_nt);
 	if (ret < 0) {
-		dev_err(panel->dev, "failed to init panel: %d\n", ret);
+		DRM_DEV_ERROR(panel->dev, "failed to init panel: %d\n", ret);
 		goto poweroff;
 	}
 
 	ret = sharp_nt_panel_on(sharp_nt);
 	if (ret < 0) {
-		dev_err(panel->dev, "failed to set panel on: %d\n", ret);
+		DRM_DEV_ERROR(panel->dev, "failed to set panel on: %d\n", ret);
 		goto poweroff;
 	}
 
@@ -232,9 +232,9 @@ static int sharp_nt_panel_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;
 	}
 
@@ -270,8 +270,8 @@ static int sharp_nt_panel_add(struct sharp_nt_panel *sharp_nt)
 
 	sharp_nt->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(sharp_nt->reset_gpio)) {
-		dev_err(dev, "cannot get reset-gpios %ld\n",
-			PTR_ERR(sharp_nt->reset_gpio));
+		DRM_DEV_ERROR(dev, "cannot get reset-gpios %ld\n",
+			      PTR_ERR(sharp_nt->reset_gpio));
 		sharp_nt->reset_gpio = NULL;
 	} else {
 		gpiod_set_value(sharp_nt->reset_gpio, 0);
@@ -346,11 +346,12 @@ static int sharp_nt_panel_remove(struct mipi_dsi_device *dsi)
 
 	ret = sharp_nt_panel_disable(&sharp_nt->base);
 	if (ret < 0)
-		dev_err(&dsi->dev, "failed to disable panel: %d\n", ret);
+		DRM_DEV_ERROR(&dsi->dev, "failed to disable panel: %d\n", ret);
 
 	ret = mipi_dsi_detach(dsi);
 	if (ret < 0)
-		dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret);
+		DRM_DEV_ERROR(&dsi->dev,
+			      "failed to detach from DSI host: %d\n", ret);
 
 	drm_panel_detach(&sharp_nt->base);
 	sharp_nt_panel_del(sharp_nt);
-- 
2.7.4



More information about the dri-devel mailing list