[PATCH v1 12/19] drm/panel: olimex: use DRM_DEV*

From: Sam Ravnborg
Date: Thu Jan 31 2019 - 14:27:34 EST


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

Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Cc: Stefan Mavrodiev <stefan@xxxxxxxxxx>
Cc: Thierry Reding <thierry.reding@xxxxxxxxx>
Cc: David Airlie <airlied@xxxxxxxx>
Cc: Daniel Vetter <daniel@xxxxxxxx>
---
drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c | 26 +++++++++++++---------
1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c
index c8704be9caa3..efb223b35594 100644
--- a/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c
+++ b/drivers/gpu/drm/panel/panel-olimex-lcd-olinuxino.c
@@ -18,6 +18,7 @@
#include <drm/drm_device.h>
#include <drm/drm_modes.h>
#include <drm/drm_panel.h>
+#include <drm/drm_print.h>

#include <video/videomode.h>
#include <video/display_timing.h>
@@ -157,10 +158,11 @@ static int lcd_olinuxino_get_modes(struct drm_panel *panel)

mode = drm_mode_create(drm);
if (!mode) {
- dev_err(drm->dev, "failed to add mode %ux%u@%u\n",
- lcd_mode->hactive,
- lcd_mode->vactive,
- lcd_mode->refresh);
+ DRM_DEV_ERROR(drm->dev,
+ "failed to add mode %ux%u@%u\n",
+ lcd_mode->hactive,
+ lcd_mode->vactive,
+ lcd_mode->refresh);
continue;
}

@@ -242,7 +244,8 @@ static int lcd_olinuxino_probe(struct i2c_client *client,
(u8 *)&lcd->eeprom + i);
mutex_unlock(&lcd->mutex);
if (ret < 0) {
- dev_err(dev, "error reading from device at %02x\n", i);
+ DRM_DEV_ERROR(dev,
+ "error reading from device at %02x\n", i);
return ret;
}
}
@@ -250,20 +253,21 @@ static int lcd_olinuxino_probe(struct i2c_client *client,
/* Check configuration checksum */
checksum = ~crc32(~0, (u8 *)&lcd->eeprom, 252);
if (checksum != lcd->eeprom.checksum) {
- dev_err(dev, "configuration checksum does not match!\n");
+ DRM_DEV_ERROR(dev,
+ "configuration checksum does not match!\n");
return -EINVAL;
}

/* Check magic header */
if (lcd->eeprom.header != LCD_OLINUXINO_HEADER_MAGIC) {
- dev_err(dev, "magic header does not match\n");
+ DRM_DEV_ERROR(dev, "magic header does not match\n");
return -EINVAL;
}

- dev_info(dev, "Detected %s, Rev. %s, Serial: %08x\n",
- lcd->eeprom.info.name,
- lcd->eeprom.revision,
- lcd->eeprom.serial);
+ DRM_DEV_INFO(dev, "Detected %s, Rev. %s, Serial: %08x\n",
+ lcd->eeprom.info.name,
+ lcd->eeprom.revision,
+ lcd->eeprom.serial);

/*
* The eeprom can hold up to 4 modes.
--
2.12.0