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-jdi-lt070me05000.c | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c index 5b2340e..9c29035 100644 --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c @@ -161,7 +161,7 @@ static int jdi_panel_on(struct jdi_panel *jdi) ret = mipi_dsi_dcs_set_display_on(dsi); if (ret < 0) - dev_err(dev, "failed to set display on: %d\n", ret); + DRM_DEV_ERROR(dev, "failed to set display on: %d\n", ret); return ret; } @@ -176,11 +176,11 @@ static void jdi_panel_off(struct jdi_panel *jdi) ret = mipi_dsi_dcs_set_display_off(dsi); if (ret < 0) - dev_err(dev, "failed to set display off: %d\n", ret); + DRM_DEV_ERROR(dev, "failed to set display off: %d\n", ret); ret = mipi_dsi_dcs_enter_sleep_mode(dsi); if (ret < 0) - dev_err(dev, "failed to enter sleep mode: %d\n", ret); + DRM_DEV_ERROR(dev, "failed to enter sleep mode: %d\n", ret); msleep(100); } @@ -213,7 +213,7 @@ static int jdi_panel_unprepare(struct drm_panel *panel) ret = regulator_bulk_disable(ARRAY_SIZE(jdi->supplies), jdi->supplies); if (ret < 0) - dev_err(dev, "regulator disable failed, %d\n", ret); + DRM_DEV_ERROR(dev, "regulator disable failed, %d\n", ret); gpiod_set_value(jdi->enable_gpio, 0); @@ -237,7 +237,7 @@ static int jdi_panel_prepare(struct drm_panel *panel) ret = regulator_bulk_enable(ARRAY_SIZE(jdi->supplies), jdi->supplies); if (ret < 0) { - dev_err(dev, "regulator enable failed, %d\n", ret); + DRM_DEV_ERROR(dev, "regulator enable failed, %d\n", ret); return ret; } @@ -254,13 +254,13 @@ static int jdi_panel_prepare(struct drm_panel *panel) ret = jdi_panel_init(jdi); if (ret < 0) { - dev_err(dev, "failed to init panel: %d\n", ret); + DRM_DEV_ERROR(dev, "failed to init panel: %d\n", ret); goto poweroff; } ret = jdi_panel_on(jdi); if (ret < 0) { - dev_err(dev, "failed to set panel on: %d\n", ret); + DRM_DEV_ERROR(dev, "failed to set panel on: %d\n", ret); goto poweroff; } @@ -271,7 +271,7 @@ static int jdi_panel_prepare(struct drm_panel *panel) poweroff: ret = regulator_bulk_disable(ARRAY_SIZE(jdi->supplies), jdi->supplies); if (ret < 0) - dev_err(dev, "regulator disable failed, %d\n", ret); + DRM_DEV_ERROR(dev, "regulator disable failed, %d\n", ret); gpiod_set_value(jdi->enable_gpio, 0); @@ -319,9 +319,9 @@ static int jdi_panel_get_modes(struct drm_panel *panel) mode = drm_mode_duplicate(panel->drm, &default_mode); if (!mode) { - dev_err(dev, "failed to add mode %ux%ux@%u\n", - default_mode.hdisplay, default_mode.vdisplay, - default_mode.vrefresh); + DRM_DEV_ERROR(dev, "failed to add mode %ux%ux@%u\n", + default_mode.hdisplay, default_mode.vdisplay, + default_mode.vrefresh); return -ENOMEM; } @@ -416,35 +416,35 @@ static int jdi_panel_add(struct jdi_panel *jdi) ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(jdi->supplies), jdi->supplies); if (ret < 0) { - dev_err(dev, "failed to init regulator, ret=%d\n", ret); + DRM_DEV_ERROR(dev, "failed to init regulator, ret=%d\n", ret); return ret; } jdi->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); if (IS_ERR(jdi->enable_gpio)) { ret = PTR_ERR(jdi->enable_gpio); - dev_err(dev, "cannot get enable-gpio %d\n", ret); + DRM_DEV_ERROR(dev, "cannot get enable-gpio %d\n", ret); return ret; } jdi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(jdi->reset_gpio)) { ret = PTR_ERR(jdi->reset_gpio); - dev_err(dev, "cannot get reset-gpios %d\n", ret); + DRM_DEV_ERROR(dev, "cannot get reset-gpios %d\n", ret); return ret; } jdi->dcdc_en_gpio = devm_gpiod_get(dev, "dcdc-en", GPIOD_OUT_LOW); if (IS_ERR(jdi->dcdc_en_gpio)) { ret = PTR_ERR(jdi->dcdc_en_gpio); - dev_err(dev, "cannot get dcdc-en-gpio %d\n", ret); + DRM_DEV_ERROR(dev, "cannot get dcdc-en-gpio %d\n", ret); return ret; } jdi->backlight = drm_panel_create_dsi_backlight(jdi->dsi); if (IS_ERR(jdi->backlight)) { ret = PTR_ERR(jdi->backlight); - dev_err(dev, "failed to register backlight %d\n", ret); + DRM_DEV_ERROR(dev, "failed to register backlight %d\n", ret); return ret; } @@ -495,12 +495,12 @@ static int jdi_panel_remove(struct mipi_dsi_device *dsi) ret = jdi_panel_disable(&jdi->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(&jdi->base); jdi_panel_del(jdi); -- 2.7.4 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel