]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/vga: conversion to drm_device based logging macros.
authorWambui Karuga <wambui.karugax@gmail.com>
Thu, 30 Jan 2020 08:32:20 +0000 (11:32 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 4 Feb 2020 09:13:20 +0000 (11:13 +0200)
Converts the printk based logging macros to the struct drm_device based
logging macros in i915/display/intel_vga.c using the following
coccinelle script that matches based on the existence of a
drm_i915_private device pointer:
@@
identifier fn, T;
@@

fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}

@@
identifier fn, T;
@@

fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}

Checkpatch warnings were addressed manually.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200130083229.12889-4-wambui.karugax@gmail.com
drivers/gpu/drm/i915/display/intel_vga.c

index 7eb23f623661902c3a5e97b00a564b268a07cb7b..be333699c515bf6bfb6dda4fb4e66f50ced3cda0 100644 (file)
@@ -46,7 +46,8 @@ void intel_vga_redisable_power_on(struct drm_i915_private *dev_priv)
        i915_reg_t vga_reg = intel_vga_cntrl_reg(dev_priv);
 
        if (!(intel_de_read(dev_priv, vga_reg) & VGA_DISP_DISABLE)) {
-               DRM_DEBUG_KMS("Something enabled VGA plane, disabling it\n");
+               drm_dbg_kms(&dev_priv->drm,
+                           "Something enabled VGA plane, disabling it\n");
                intel_vga_disable(dev_priv);
        }
 }
@@ -99,7 +100,7 @@ intel_vga_set_state(struct drm_i915_private *i915, bool enable_decode)
        u16 gmch_ctrl;
 
        if (pci_read_config_word(i915->bridge_dev, reg, &gmch_ctrl)) {
-               DRM_ERROR("failed to read control word\n");
+               drm_err(&i915->drm, "failed to read control word\n");
                return -EIO;
        }
 
@@ -112,7 +113,7 @@ intel_vga_set_state(struct drm_i915_private *i915, bool enable_decode)
                gmch_ctrl |= INTEL_GMCH_VGA_DISABLE;
 
        if (pci_write_config_word(i915->bridge_dev, reg, gmch_ctrl)) {
-               DRM_ERROR("failed to write control word\n");
+               drm_err(&i915->drm, "failed to write control word\n");
                return -EIO;
        }