public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Thierry Reding <thierry.reding@gmail.com>,
	dri-devel@lists.freedesktop.org
Cc: Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	Linus Walleij <linus.walleij@linaro.org>,
	Stefan Mavrodiev <stefan@olimex.com>,
	linux-kernel@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>
Subject: [PATCH v1 03/19] drm/panel: samsung: use DRM_DEV*
Date: Thu, 31 Jan 2019 20:26:03 +0100	[thread overview]
Message-ID: <20190131192619.9763-4-sam@ravnborg.org> (raw)
In-Reply-To: <20190131192619.9763-1-sam@ravnborg.org>

Introduce use of DRM_DEV* for logging.
This makes logging in the drm subsystem more consistent.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
 drivers/gpu/drm/panel/panel-samsung-ld9040.c     | 12 +++++------
 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c    | 15 +++++++-------
 drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c |  8 ++++----
 drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c    | 26 +++++++++++++-----------
 4 files changed, 32 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-samsung-ld9040.c b/drivers/gpu/drm/panel/panel-samsung-ld9040.c
index 7d27b79d0b2a..fec639c19d74 100644
--- a/drivers/gpu/drm/panel/panel-samsung-ld9040.c
+++ b/drivers/gpu/drm/panel/panel-samsung-ld9040.c
@@ -149,7 +149,7 @@ static void ld9040_dcs_write(struct ld9040 *ctx, const u8 *data, size_t len)
 	if (ctx->error < 0 || len == 0)
 		return;
 
-	dev_dbg(ctx->dev, "writing dcs seq: %*ph\n", (int)len, data);
+	DRM_DEV_DEBUG(ctx->dev, "writing dcs seq: %*ph\n", (int)len, data);
 	ret = ld9040_spi_write_word(ctx, *data);
 
 	while (!ret && --len) {
@@ -158,8 +158,8 @@ static void ld9040_dcs_write(struct ld9040 *ctx, const u8 *data, size_t len)
 	}
 
 	if (ret) {
-		dev_err(ctx->dev, "error %d writing dcs seq: %*ph\n", ret,
-			(int)len, data);
+		DRM_DEV_ERROR(ctx->dev, "error %d writing dcs seq: %*ph\n",
+			      ret, (int)len, data);
 		ctx->error = ret;
 	}
 
@@ -342,15 +342,15 @@ static int ld9040_probe(struct spi_device *spi)
 
 	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(ctx->reset_gpio)) {
-		dev_err(dev, "cannot get reset-gpios %ld\n",
-			PTR_ERR(ctx->reset_gpio));
+		DRM_DEV_ERROR(dev, "cannot get reset-gpios %ld\n",
+			      PTR_ERR(ctx->reset_gpio));
 		return PTR_ERR(ctx->reset_gpio);
 	}
 
 	spi->bits_per_word = 9;
 	ret = spi_setup(spi);
 	if (ret < 0) {
-		dev_err(dev, "spi setup failed.\n");
+		DRM_DEV_ERROR(dev, "spi setup failed.\n");
 		return ret;
 	}
 
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
index 813afee82ec9..e2f2ee252409 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c
@@ -458,7 +458,8 @@ static int s6e3ha2_set_brightness(struct backlight_device *bl_dev)
 
 	if (brightness < S6E3HA2_MIN_BRIGHTNESS ||
 		brightness > bl_dev->props.max_brightness) {
-		dev_err(ctx->dev, "Invalid brightness: %u\n", brightness);
+		DRM_DEV_ERROR(ctx->dev, "Invalid brightness: %u\n",
+			      brightness);
 		return -EINVAL;
 	}
 
@@ -706,28 +707,28 @@ static int s6e3ha2_probe(struct mipi_dsi_device *dsi)
 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
 				      ctx->supplies);
 	if (ret < 0) {
-		dev_err(dev, "failed to get regulators: %d\n", ret);
+		DRM_DEV_ERROR(dev, "failed to get regulators: %d\n", ret);
 		return ret;
 	}
 
 	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(ctx->reset_gpio)) {
-		dev_err(dev, "cannot get reset-gpios %ld\n",
-			PTR_ERR(ctx->reset_gpio));
+		DRM_DEV_ERROR(dev, "cannot get reset-gpios %ld\n",
+			      PTR_ERR(ctx->reset_gpio));
 		return PTR_ERR(ctx->reset_gpio);
 	}
 
 	ctx->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
 	if (IS_ERR(ctx->enable_gpio)) {
-		dev_err(dev, "cannot get enable-gpios %ld\n",
-			PTR_ERR(ctx->enable_gpio));
+		DRM_DEV_ERROR(dev, "cannot get enable-gpios %ld\n",
+			      PTR_ERR(ctx->enable_gpio));
 		return PTR_ERR(ctx->enable_gpio);
 	}
 
 	ctx->bl_dev = backlight_device_register("s6e3ha2", dev, ctx,
 						&s6e3ha2_bl_ops, NULL);
 	if (IS_ERR(ctx->bl_dev)) {
-		dev_err(dev, "failed to register backlight device\n");
+		DRM_DEV_ERROR(dev, "failed to register backlight device\n");
 		return PTR_ERR(ctx->bl_dev);
 	}
 
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
index f1c8000e0386..dd50f4089923 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
@@ -458,14 +458,14 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
 				      ctx->supplies);
 	if (ret < 0) {
-		dev_err(dev, "failed to get regulators: %d\n", ret);
+		DRM_DEV_ERROR(dev, "failed to get regulators: %d\n", ret);
 		return ret;
 	}
 
 	ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW);
 	if (IS_ERR(ctx->reset_gpio)) {
-		dev_err(dev, "cannot get reset-gpio: %ld\n",
-				PTR_ERR(ctx->reset_gpio));
+		DRM_DEV_ERROR(dev, "cannot get reset-gpio: %ld\n",
+			      PTR_ERR(ctx->reset_gpio));
 		return PTR_ERR(ctx->reset_gpio);
 	}
 
@@ -476,7 +476,7 @@ static int s6e63j0x03_probe(struct mipi_dsi_device *dsi)
 	ctx->bl_dev = backlight_device_register("s6e63j0x03", dev, ctx,
 						&s6e63j0x03_bl_ops, NULL);
 	if (IS_ERR(ctx->bl_dev)) {
-		dev_err(dev, "failed to register backlight device\n");
+		DRM_DEV_ERROR(dev, "failed to register backlight device\n");
 		return PTR_ERR(ctx->bl_dev);
 	}
 
diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
index b252d23f386f..e3e0766c3a17 100644
--- a/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
+++ b/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
@@ -147,8 +147,8 @@ static void s6e8aa0_dcs_write(struct s6e8aa0 *ctx, const void *data, size_t len)
 
 	ret = mipi_dsi_dcs_write_buffer(dsi, data, len);
 	if (ret < 0) {
-		dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret,
-			(int)len, data);
+		DRM_DEV_ERROR(ctx->dev, "error %zd writing dcs seq: %*ph\n",
+			      ret, (int)len, data);
 		ctx->error = ret;
 	}
 }
@@ -163,7 +163,8 @@ static int s6e8aa0_dcs_read(struct s6e8aa0 *ctx, u8 cmd, void *data, size_t len)
 
 	ret = mipi_dsi_dcs_read(dsi, cmd, data, len);
 	if (ret < 0) {
-		dev_err(ctx->dev, "error %d reading dcs seq(%#x)\n", ret, cmd);
+		DRM_DEV_ERROR(ctx->dev, "error %d reading dcs seq(%#x)\n",
+			      ret, cmd);
 		ctx->error = ret;
 	}
 
@@ -814,9 +815,9 @@ static void s6e8aa0_set_maximum_return_packet_size(struct s6e8aa0 *ctx,
 
 	ret = mipi_dsi_set_maximum_return_packet_size(dsi, size);
 	if (ret < 0) {
-		dev_err(ctx->dev,
-			"error %d setting maximum return packet size to %d\n",
-			ret, size);
+		DRM_DEV_ERROR(ctx->dev,
+			      "error %d setting maximum return packet size to %d\n",
+			      ret, size);
 		ctx->error = ret;
 	}
 }
@@ -825,22 +826,23 @@ static void s6e8aa0_read_mtp_id(struct s6e8aa0 *ctx)
 {
 	u8 id[3];
 	int ret, i;
+	struct device *dev = ctx->dev;
 
 	ret = s6e8aa0_dcs_read(ctx, 0xd1, id, ARRAY_SIZE(id));
 	if (ret < 0 || ret < ARRAY_SIZE(id) || id[0] == 0x00) {
-		dev_err(ctx->dev, "read id failed\n");
+		DRM_DEV_ERROR(dev, "read id failed\n");
 		ctx->error = -EIO;
 		return;
 	}
 
-	dev_info(ctx->dev, "ID: 0x%2x, 0x%2x, 0x%2x\n", id[0], id[1], id[2]);
+	DRM_DEV_INFO(dev, "ID: 0x%2x, 0x%2x, 0x%2x\n", id[0], id[1], id[2]);
 
 	for (i = 0; i < ARRAY_SIZE(s6e8aa0_variants); ++i) {
 		if (id[1] == s6e8aa0_variants[i].version)
 			break;
 	}
 	if (i >= ARRAY_SIZE(s6e8aa0_variants)) {
-		dev_err(ctx->dev, "unsupported display version %d\n", id[1]);
+		DRM_DEV_ERROR(dev, "unsupported display version %d\n", id[1]);
 		ctx->error = -EINVAL;
 		return;
 	}
@@ -1007,14 +1009,14 @@ static int s6e8aa0_probe(struct mipi_dsi_device *dsi)
 	ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies),
 				      ctx->supplies);
 	if (ret < 0) {
-		dev_err(dev, "failed to get regulators: %d\n", ret);
+		DRM_DEV_ERROR(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)) {
-		dev_err(dev, "cannot get reset-gpios %ld\n",
-			PTR_ERR(ctx->reset_gpio));
+		DRM_DEV_ERROR(dev, "cannot get reset-gpios %ld\n",
+			      PTR_ERR(ctx->reset_gpio));
 		return PTR_ERR(ctx->reset_gpio);
 	}
 
-- 
2.12.0


  parent reply	other threads:[~2019-01-31 19:26 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 19:26 [PATCH v1 0/19] drm/panel: drmP.h removal and DRM_DEV* Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 01/19] drm/panel: drop drmP.h usage Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 02/19] drm/panel: panel-innolux: drop unused variable Sam Ravnborg
2019-01-31 19:26 ` Sam Ravnborg [this message]
2019-01-31 19:26 ` [PATCH v1 04/19] drm/panel: arm-versatile: use DRM_DEV* Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 05/19] drm/panel: truly: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 06/19] drm/panel: sitronix: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 07/19] drm/panel: ilitek: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 08/19] drm/panel: innolux: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 09/19] drm/panel: jdi: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 10/19] drm/panel: lg: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 11/19] drm/panel: lvds: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 12/19] drm/panel: olimex: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 13/19] drm/panel: orisetech: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 14/19] drm/panel: panasonic: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 15/19] drm/panel: raspberrypi: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 16/19] drm/panel: raydium: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 17/19] drm/panel: seiko: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 18/19] drm/panel: sharp: " Sam Ravnborg
2019-01-31 19:26 ` [PATCH v1 19/19] drm/panel: simple: " Sam Ravnborg
2019-01-31 19:33 ` [PATCH v1 0/19] drm/panel: drmP.h removal and DRM_DEV* Sam Ravnborg
2019-01-31 20:07 ` Sean Paul
2019-01-31 21:03   ` Sam Ravnborg
2019-01-31 21:54     ` Thierry Reding
2019-02-01  9:20       ` Sam Ravnborg
2019-02-01 10:30         ` Jani Nikula
2019-02-01 10:52           ` Andrzej Hajda
2019-02-01 11:13             ` Jani Nikula
2019-02-01 13:37       ` Sam Ravnborg
2019-02-02  1:31         ` Joe Perches
2019-02-04 18:42           ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190131192619.9763-4-sam@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefan@olimex.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox