]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/combo_phy: convert to struct drm_device logging macros.
authorWambui Karuga <wambui.karugax@gmail.com>
Thu, 6 Feb 2020 08:00:09 +0000 (11:00 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 11 Feb 2020 13:23:33 +0000 (15:23 +0200)
Conversion of the printk based drm logging macros to the struct
drm_device based logging macros in i915/display/intel_combo_phy.c.
This transformation was achieved 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_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&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_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}

This converts DRM_DEBUG/DRM_DEBUG_DRIVER to drm_dbg().
New checkpatch warnings were addressed manually.

References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html
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/20200206080014.13759-9-wambui.karugax@gmail.com
drivers/gpu/drm/i915/display/intel_combo_phy.c

index dc5525ee8dee132b6f7be149fafdba63731ef09c..9ff05ec12115eb1d13935d77b9c4cb5743617630 100644 (file)
@@ -97,10 +97,11 @@ static bool check_phy_reg(struct drm_i915_private *dev_priv,
        u32 val = intel_de_read(dev_priv, reg);
 
        if ((val & mask) != expected_val) {
-               DRM_DEBUG_DRIVER("Combo PHY %c reg %08x state mismatch: "
-                                "current %08x mask %08x expected %08x\n",
-                                phy_name(phy),
-                                reg.reg, val, mask, expected_val);
+               drm_dbg(&dev_priv->drm,
+                       "Combo PHY %c reg %08x state mismatch: "
+                       "current %08x mask %08x expected %08x\n",
+                       phy_name(phy),
+                       reg.reg, val, mask, expected_val);
                return false;
        }
 
@@ -172,7 +173,8 @@ static void cnl_combo_phys_uninit(struct drm_i915_private *dev_priv)
        u32 val;
 
        if (!cnl_combo_phy_verify_state(dev_priv))
-               DRM_WARN("Combo PHY HW state changed unexpectedly.\n");
+               drm_warn(&dev_priv->drm,
+                        "Combo PHY HW state changed unexpectedly.\n");
 
        val = intel_de_read(dev_priv, CHICKEN_MISC_2);
        val |= CNL_COMP_PWR_DOWN;
@@ -212,7 +214,8 @@ static bool ehl_vbt_ddi_d_present(struct drm_i915_private *i915)
         * in the log and let the internal display win.
         */
        if (ddi_d_present)
-               DRM_ERROR("VBT claims to have both internal and external displays on PHY A.  Configuring for internal.\n");
+               drm_err(&i915->drm,
+                       "VBT claims to have both internal and external displays on PHY A.  Configuring for internal.\n");
 
        return false;
 }
@@ -308,8 +311,9 @@ static void icl_combo_phys_init(struct drm_i915_private *dev_priv)
                u32 val;
 
                if (icl_combo_phy_verify_state(dev_priv, phy)) {
-                       DRM_DEBUG_DRIVER("Combo PHY %c already enabled, won't reprogram it.\n",
-                                        phy_name(phy));
+                       drm_dbg(&dev_priv->drm,
+                               "Combo PHY %c already enabled, won't reprogram it.\n",
+                               phy_name(phy));
                        continue;
                }
 
@@ -368,7 +372,8 @@ static void icl_combo_phys_uninit(struct drm_i915_private *dev_priv)
 
                if (phy == PHY_A &&
                    !icl_combo_phy_verify_state(dev_priv, phy))
-                       DRM_WARN("Combo PHY %c HW state changed unexpectedly\n",
+                       drm_warn(&dev_priv->drm,
+                                "Combo PHY %c HW state changed unexpectedly\n",
                                 phy_name(phy));
 
                /*