From 5936b3bdaa888907596df0a954db4d14657ec621 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sat, 15 Aug 2020 14:54:02 +0200 Subject: [PATCH] drm/panel: samsung: Use dev_ based logging MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Standardize on the dev_ based logging and drop the include of drm_print.h. Fix a few cases where "x@" was used when printing the mode. Signed-off-by: Sam Ravnborg Reviewed-by: Linus Walleij Reviewed-by: Guido Günther Cc: Thierry Reding Cc: Sam Ravnborg Cc: Guido Günther Cc: Linus Walleij Cc: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20200815125406.1153224-2-sam@ravnborg.org --- drivers/gpu/drm/panel/panel-samsung-ld9040.c | 3 +-- drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 23 +++++++------------ drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 3 +-- .../gpu/drm/panel/panel-samsung-s6e63j0x03.c | 3 +-- drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 22 ++++++++---------- drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c | 3 +-- 6 files changed, 21 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-samsung-ld9040.c b/drivers/gpu/drm/panel/panel-samsung-ld9040.c index 358168ed8355..f484147fc3a6 100644 --- a/drivers/gpu/drm/panel/panel-samsung-ld9040.c +++ b/drivers/gpu/drm/panel/panel-samsung-ld9040.c @@ -21,7 +21,6 @@ #include #include -#include /* Manufacturer Command Set */ #define MCS_MANPWR 0xb0 @@ -269,7 +268,7 @@ static int ld9040_get_modes(struct drm_panel *panel, mode = drm_mode_create(connector->dev); if (!mode) { - DRM_ERROR("failed to create a new display mode\n"); + dev_err(panel->dev, "failed to create a new display mode\n"); return 0; } diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c index e88af6f8bf60..4aac0d1573dd 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -55,8 +54,7 @@ static int s6d16d0_unprepare(struct drm_panel *panel) /* Enter sleep mode */ ret = mipi_dsi_dcs_enter_sleep_mode(dsi); if (ret) { - DRM_DEV_ERROR(s6->dev, "failed to enter sleep mode (%d)\n", - ret); + dev_err(s6->dev, "failed to enter sleep mode (%d)\n", ret); return ret; } @@ -75,7 +73,7 @@ static int s6d16d0_prepare(struct drm_panel *panel) ret = regulator_enable(s6->supply); if (ret) { - DRM_DEV_ERROR(s6->dev, "failed to enable supply (%d)\n", ret); + dev_err(s6->dev, "failed to enable supply (%d)\n", ret); return ret; } @@ -90,15 +88,13 @@ static int s6d16d0_prepare(struct drm_panel *panel) ret = mipi_dsi_dcs_set_tear_on(dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); if (ret) { - DRM_DEV_ERROR(s6->dev, "failed to enable vblank TE (%d)\n", - ret); + dev_err(s6->dev, "failed to enable vblank TE (%d)\n", ret); return ret; } /* Exit sleep mode and power on */ ret = mipi_dsi_dcs_exit_sleep_mode(dsi); if (ret) { - DRM_DEV_ERROR(s6->dev, "failed to exit sleep mode (%d)\n", - ret); + dev_err(s6->dev, "failed to exit sleep mode (%d)\n", ret); return ret; } @@ -113,8 +109,7 @@ static int s6d16d0_enable(struct drm_panel *panel) ret = mipi_dsi_dcs_set_display_on(dsi); if (ret) { - DRM_DEV_ERROR(s6->dev, "failed to turn display on (%d)\n", - ret); + dev_err(s6->dev, "failed to turn display on (%d)\n", ret); return ret; } @@ -129,8 +124,7 @@ static int s6d16d0_disable(struct drm_panel *panel) ret = mipi_dsi_dcs_set_display_off(dsi); if (ret) { - DRM_DEV_ERROR(s6->dev, "failed to turn display off (%d)\n", - ret); + dev_err(s6->dev, "failed to turn display off (%d)\n", ret); return ret; } @@ -144,7 +138,7 @@ static int s6d16d0_get_modes(struct drm_panel *panel, mode = drm_mode_duplicate(connector->dev, &samsung_s6d16d0_mode); if (!mode) { - DRM_ERROR("bad mode or failed to add mode\n"); + dev_err(panel->dev, "bad mode or failed to add mode\n"); return -EINVAL; } drm_mode_set_name(mode); @@ -204,8 +198,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi) if (IS_ERR(s6->reset_gpio)) { ret = PTR_ERR(s6->reset_gpio); if (ret != -EPROBE_DEFER) - DRM_DEV_ERROR(dev, "failed to request GPIO (%d)\n", - ret); + dev_err(dev, "failed to request GPIO (%d)\n", ret); return ret; } diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c index 2c84036c6a65..1d1c79a18613 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -18,7 +18,6 @@ #include #include #include -#include #define S6E3HA2_MIN_BRIGHTNESS 0 #define S6E3HA2_MAX_BRIGHTNESS 100 @@ -651,7 +650,7 @@ static int s6e3ha2_get_modes(struct drm_panel *panel, mode = drm_mode_duplicate(connector->dev, ctx->desc->mode); if (!mode) { - DRM_ERROR("failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%u@%u\n", ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, drm_mode_vrefresh(ctx->desc->mode)); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c index 7a43eb3545cf..b962c817fb30 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c @@ -19,7 +19,6 @@ #include #include #include -#include #define MCS_LEVEL2_KEY 0xf0 #define MCS_MTP_KEY 0xf1 @@ -406,7 +405,7 @@ static int s6e63j0x03_get_modes(struct drm_panel *panel, mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - DRM_ERROR("failed to add mode %ux%ux@%u\n", + dev_err(panel->dev, "failed to add mode %ux%u@%u\n", default_mode.hdisplay, default_mode.vdisplay, drm_mode_vrefresh(&default_mode)); return -ENOMEM; diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c index e086efea2950..2cc772fdc456 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0.c @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -157,7 +156,7 @@ static void s6e63m0_dcs_write(struct s6e63m0 *ctx, const u8 *data, size_t len) if (ctx->error < 0 || len == 0) return; - DRM_DEV_DEBUG(ctx->dev, "writing dcs seq: %*ph\n", (int)len, data); + dev_dbg(ctx->dev, "writing dcs seq: %*ph\n", (int)len, data); ret = s6e63m0_spi_write_word(ctx, *data); while (!ret && --len) { @@ -166,8 +165,7 @@ static void s6e63m0_dcs_write(struct s6e63m0 *ctx, const u8 *data, size_t len) } if (ret) { - DRM_DEV_ERROR(ctx->dev, "error %d writing dcs seq: %*ph\n", ret, - (int)len, data); + dev_err(ctx->dev, "error %d writing dcs seq: %*ph\n", ret, (int)len, data); ctx->error = ret; } @@ -368,9 +366,9 @@ static int s6e63m0_get_modes(struct drm_panel *panel, mode = drm_mode_duplicate(connector->dev, &default_mode); if (!mode) { - DRM_ERROR("failed to add mode %ux%ux@%u\n", - default_mode.hdisplay, default_mode.vdisplay, - drm_mode_vrefresh(&default_mode)); + dev_err(panel->dev, "failed to add mode %ux%u@%u\n", + default_mode.hdisplay, default_mode.vdisplay, + drm_mode_vrefresh(&default_mode)); return -ENOMEM; } @@ -425,8 +423,7 @@ static int s6e63m0_backlight_register(struct s6e63m0 *ctx) &props); if (IS_ERR(ctx->bl_dev)) { ret = PTR_ERR(ctx->bl_dev); - DRM_DEV_ERROR(dev, "error registering backlight device (%d)\n", - ret); + dev_err(dev, "error registering backlight device (%d)\n", ret); } return ret; @@ -453,14 +450,13 @@ static int s6e63m0_probe(struct spi_device *spi) ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), ctx->supplies); if (ret < 0) { - DRM_DEV_ERROR(dev, "failed to get regulators: %d\n", ret); + dev_err(dev, "failed to get regulators: %d\n", ret); return ret; } ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(ctx->reset_gpio)) { - DRM_DEV_ERROR(dev, "cannot get reset-gpios %ld\n", - PTR_ERR(ctx->reset_gpio)); + dev_err(dev, "cannot get reset-gpios %ld\n", PTR_ERR(ctx->reset_gpio)); return PTR_ERR(ctx->reset_gpio); } @@ -468,7 +464,7 @@ static int s6e63m0_probe(struct spi_device *spi) spi->mode = SPI_MODE_3; ret = spi_setup(spi); if (ret < 0) { - DRM_DEV_ERROR(dev, "spi setup failed.\n"); + dev_err(dev, "spi setup failed.\n"); return ret; } diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c index e36cb1a25318..527371120266 100644 --- a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c +++ b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c @@ -25,7 +25,6 @@ #include #include #include -#include #define LDI_MTP_LENGTH 24 #define GAMMA_LEVEL_NUM 25 @@ -928,7 +927,7 @@ static int s6e8aa0_get_modes(struct drm_panel *panel, mode = drm_mode_create(connector->dev); if (!mode) { - DRM_ERROR("failed to create a new display mode\n"); + dev_err(panel->dev, "failed to create a new display mode\n"); return 0; } -- 2.34.1