drm/panel: samsung: Use dev_ based logging

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 <sam@ravnborg.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Guido Günther <agx@sigxcpu.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200815125406.1153224-2-sam@ravnborg.org
This commit is contained in:
Sam Ravnborg 2020-08-15 14:54:02 +02:00
parent 72967d5616
commit 5936b3bdaa
6 changed files with 21 additions and 36 deletions

View File

@ -21,7 +21,6 @@
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
/* 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;
}

View File

@ -7,7 +7,6 @@
#include <drm/drm_modes.h>
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <linux/gpio/consumer.h>
#include <linux/regulator/consumer.h>
@ -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;
}

View File

@ -18,7 +18,6 @@
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#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;

View File

@ -19,7 +19,6 @@
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#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;

View File

@ -10,7 +10,6 @@
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <linux/backlight.h>
#include <linux/delay.h>
@ -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;
}

View File

@ -25,7 +25,6 @@
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#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;
}