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

Aastha Gupta aastha.gupta4104 at gmail.com
Tue Oct 24 14:10:57 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-lvds.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-lvds.c b/drivers/gpu/drm/panel/panel-lvds.c
index e2d57c0..e19ad41 100644
--- a/drivers/gpu/drm/panel/panel-lvds.c
+++ b/drivers/gpu/drm/panel/panel-lvds.c
@@ -143,14 +143,16 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
 
 	ret = of_property_read_u32(np, "width-mm", &lvds->width);
 	if (ret < 0) {
-		dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n",
-			np, "width-mm");
+		DRM_DEV_ERROR(lvds->dev,
+			      "%pOF: invalid or missing %s DT property\n",
+			      np, "width-mm");
 		return -ENODEV;
 	}
 	ret = of_property_read_u32(np, "height-mm", &lvds->height);
 	if (ret < 0) {
-		dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n",
-			np, "height-mm");
+		DRM_DEV_ERROR(lvds->dev,
+			      "%pOF: invalid or missing %s DT property\n",
+			      np, "height-mm");
 		return -ENODEV;
 	}
 
@@ -158,8 +160,9 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
 
 	ret = of_property_read_string(np, "data-mapping", &mapping);
 	if (ret < 0) {
-		dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n",
-			np, "data-mapping");
+		DRM_DEV_ERROR(lvds->dev,
+			      "%pOF: invalid or missing %s DT property\n",
+			      np, "data-mapping");
 		return -ENODEV;
 	}
 
@@ -170,8 +173,9 @@ static int panel_lvds_parse_dt(struct panel_lvds *lvds)
 	} else if (!strcmp(mapping, "vesa-24")) {
 		lvds->bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG;
 	} else {
-		dev_err(lvds->dev, "%pOF: invalid or missing %s DT property\n",
-			np, "data-mapping");
+		DRM_DEV_ERROR(lvds->dev,
+			      "%pOF: invalid or missing %s DT property\n",
+			      np, "data-mapping");
 		return -EINVAL;
 	}
 
@@ -201,8 +205,8 @@ static int panel_lvds_probe(struct platform_device *pdev)
 						     GPIOD_OUT_LOW);
 	if (IS_ERR(lvds->enable_gpio)) {
 		ret = PTR_ERR(lvds->enable_gpio);
-		dev_err(lvds->dev, "failed to request %s GPIO: %d\n",
-			"enable", ret);
+		DRM_DEV_ERROR(lvds->dev, "failed to request %s GPIO: %d\n",
+			      "enable", ret);
 		return ret;
 	}
 
@@ -210,8 +214,8 @@ static int panel_lvds_probe(struct platform_device *pdev)
 						     GPIOD_OUT_HIGH);
 	if (IS_ERR(lvds->reset_gpio)) {
 		ret = PTR_ERR(lvds->reset_gpio);
-		dev_err(lvds->dev, "failed to request %s GPIO: %d\n",
-			"reset", ret);
+		DRM_DEV_ERROR(lvds->dev, "failed to request %s GPIO: %d\n",
+			      "reset", ret);
 		return ret;
 	}
 
-- 
2.7.4



More information about the dri-devel mailing list