drm/i915: Propagate "_release" function name suffix down
authorJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Fri, 12 Jul 2019 11:24:28 +0000 (13:24 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 12 Jul 2019 12:05:05 +0000 (13:05 +0100)
Replace mixed "_fini"/"_cleanup"/"_cleanup_hw" suffixes found in names
of functions called from i915_driver_release() with "_release" suffix
consistently.  This provides better code readability, especially
helpful when trying to work out which phase the code is in.

Functions names starting with "i915_driver_", i.e., those defined in
drivers/gpu/dri/i915/i915_drv.c, just have their "cleanup" or "fini"
parts of their names replaced with the "_release" suffix, while names
of functions coming from other source files have been suffixed with
"_driver_release" to avoid ambiguity with other possible .release entry
points.

v2: early_probe pairs better with late_release (Chris)
v3: fix typo in commit message (Joonas)

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190712112429.740-5-janusz.krzysztofik@linux.intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_gtt.h
drivers/gpu/drm/i915/intel_runtime_pm.c
drivers/gpu/drm/i915/intel_runtime_pm.h

index 7371571d735db6c8b999d5399e882e2caf6864cc..60dad4450e28236da0ffe3870fa00ddf4c79192e 100644 (file)
@@ -758,7 +758,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
 cleanup_gem:
        i915_gem_suspend(dev_priv);
        i915_gem_fini_hw(dev_priv);
-       i915_gem_fini(dev_priv);
+       i915_gem_driver_release(dev_priv);
 cleanup_modeset:
        intel_modeset_cleanup(dev);
 cleanup_irq:
@@ -968,10 +968,11 @@ err_engines:
 }
 
 /**
- * i915_driver_cleanup_early - cleanup the setup done in i915_driver_init_early()
+ * i915_driver_late_release - cleanup the setup done in
+ *                            i915_driver_init_early()
  * @dev_priv: device private
  */
-static void i915_driver_cleanup_early(struct drm_i915_private *dev_priv)
+static void i915_driver_late_release(struct drm_i915_private *dev_priv)
 {
        intel_irq_fini(dev_priv);
        intel_power_domains_cleanup(dev_priv);
@@ -1034,10 +1035,10 @@ err_bridge:
 }
 
 /**
- * i915_driver_cleanup_mmio - cleanup the setup done in i915_driver_init_mmio()
+ * i915_driver_mmio_release - cleanup the setup done in i915_driver_init_mmio()
  * @dev_priv: device private
  */
-static void i915_driver_cleanup_mmio(struct drm_i915_private *dev_priv)
+static void i915_driver_mmio_release(struct drm_i915_private *dev_priv)
 {
        intel_teardown_mchbar(dev_priv);
        intel_uncore_fini_mmio(&dev_priv->uncore);
@@ -1690,7 +1691,7 @@ err_msi:
                pci_disable_msi(pdev);
        pm_qos_remove_request(&dev_priv->pm_qos);
 err_ggtt:
-       i915_ggtt_cleanup_hw(dev_priv);
+       i915_ggtt_driver_release(dev_priv);
 err_perf:
        i915_perf_fini(dev_priv);
        return ret;
@@ -1935,15 +1936,15 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 out_cleanup_hw:
        i915_driver_cleanup_hw(dev_priv);
-       i915_ggtt_cleanup_hw(dev_priv);
+       i915_ggtt_driver_release(dev_priv);
 
        /* Paranoia: make sure we have disabled everything before we exit. */
        intel_sanitize_gt_powersave(dev_priv);
 out_cleanup_mmio:
-       i915_driver_cleanup_mmio(dev_priv);
+       i915_driver_mmio_release(dev_priv);
 out_runtime_pm_put:
        enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
-       i915_driver_cleanup_early(dev_priv);
+       i915_driver_late_release(dev_priv);
 out_pci_disable:
        pci_disable_device(pdev);
 out_fini:
@@ -2006,19 +2007,19 @@ static void i915_driver_release(struct drm_device *dev)
 
        disable_rpm_wakeref_asserts(rpm);
 
-       i915_gem_fini(dev_priv);
+       i915_gem_driver_release(dev_priv);
 
-       i915_ggtt_cleanup_hw(dev_priv);
+       i915_ggtt_driver_release(dev_priv);
 
        /* Paranoia: make sure we have disabled everything before we exit. */
        intel_sanitize_gt_powersave(dev_priv);
 
-       i915_driver_cleanup_mmio(dev_priv);
+       i915_driver_mmio_release(dev_priv);
 
        enable_rpm_wakeref_asserts(rpm);
-       intel_runtime_pm_cleanup(rpm);
+       intel_runtime_pm_driver_release(rpm);
 
-       i915_driver_cleanup_early(dev_priv);
+       i915_driver_late_release(dev_priv);
        i915_driver_destroy(dev_priv);
 }
 
@@ -2211,7 +2212,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
 out:
        enable_rpm_wakeref_asserts(rpm);
        if (!dev_priv->uncore.user_forcewake.count)
-               intel_runtime_pm_cleanup(rpm);
+               intel_runtime_pm_driver_release(rpm);
 
        return ret;
 }
@@ -2975,7 +2976,7 @@ static int intel_runtime_suspend(struct device *kdev)
        }
 
        enable_rpm_wakeref_asserts(rpm);
-       intel_runtime_pm_cleanup(rpm);
+       intel_runtime_pm_driver_release(rpm);
 
        if (intel_uncore_arm_unclaimed_mmio_detection(&dev_priv->uncore))
                DRM_ERROR("Unclaimed access detected prior to suspending\n");
index af07d8d4ac10ce8b1204679de43eb213ce179a28..60e1e84a5862f1742e72cb0296526704ddd7359f 100644 (file)
@@ -2538,7 +2538,7 @@ void i915_gem_init_mmio(struct drm_i915_private *i915);
 int __must_check i915_gem_init(struct drm_i915_private *dev_priv);
 int __must_check i915_gem_init_hw(struct drm_i915_private *dev_priv);
 void i915_gem_fini_hw(struct drm_i915_private *dev_priv);
-void i915_gem_fini(struct drm_i915_private *dev_priv);
+void i915_gem_driver_release(struct drm_i915_private *dev_priv);
 int i915_gem_wait_for_idle(struct drm_i915_private *dev_priv,
                           unsigned int flags, long timeout);
 void i915_gem_suspend(struct drm_i915_private *dev_priv);
index 01520874140539a9287c083f7f61c836e2fa95ea..51a0fbaa781be8f27f3abfdac11ed3c8fd9e0bab 100644 (file)
@@ -1620,7 +1620,7 @@ void i915_gem_fini_hw(struct drm_i915_private *dev_priv)
        i915_gem_drain_freed_objects(dev_priv);
 }
 
-void i915_gem_fini(struct drm_i915_private *dev_priv)
+void i915_gem_driver_release(struct drm_i915_private *dev_priv)
 {
        mutex_lock(&dev_priv->drm.struct_mutex);
        intel_engines_cleanup(dev_priv);
index 753090a7729ed53c9125ac3774ad689c09c823b1..7352b9ef6c0ae83b8c85ae0e6abbad854ee97fcd 100644 (file)
@@ -2851,10 +2851,10 @@ static void ggtt_cleanup_hw(struct i915_ggtt *ggtt)
 }
 
 /**
- * i915_ggtt_cleanup_hw - Clean up GGTT hardware initialization
+ * i915_ggtt_driver_release - Clean up GGTT hardware initialization
  * @i915: i915 device
  */
-void i915_ggtt_cleanup_hw(struct drm_i915_private *i915)
+void i915_ggtt_driver_release(struct drm_i915_private *i915)
 {
        struct pagevec *pvec;
 
index b30ffe333852fb4451f6c431c9de78218bff39dd..a450349b3a5026b6394a6dd8ffecc3794fe2b039 100644 (file)
@@ -634,7 +634,7 @@ int i915_ggtt_enable_hw(struct drm_i915_private *dev_priv);
 void i915_ggtt_enable_guc(struct drm_i915_private *i915);
 void i915_ggtt_disable_guc(struct drm_i915_private *i915);
 int i915_init_ggtt(struct drm_i915_private *dev_priv);
-void i915_ggtt_cleanup_hw(struct drm_i915_private *dev_priv);
+void i915_ggtt_driver_release(struct drm_i915_private *dev_priv);
 
 int i915_ppgtt_init_hw(struct intel_gt *gt);
 
index 8d1aebc3e8574652153553f82370f7a210d14c84..b2a05850ea42c63fb42ef799592cd85c2d757eaa 100644 (file)
@@ -592,7 +592,7 @@ void intel_runtime_pm_disable(struct intel_runtime_pm *rpm)
                pm_runtime_put(kdev);
 }
 
-void intel_runtime_pm_cleanup(struct intel_runtime_pm *rpm)
+void intel_runtime_pm_driver_release(struct intel_runtime_pm *rpm)
 {
        int count = atomic_read(&rpm->wakeref_count);
 
index 473c4850c01d0c6dacdaff180c0f1bf4077652b4..89f8d284239ab3559c72373eedd4a7c04cba0e27 100644 (file)
@@ -173,7 +173,7 @@ enable_rpm_wakeref_asserts(struct intel_runtime_pm *rpm)
 void intel_runtime_pm_init_early(struct intel_runtime_pm *rpm);
 void intel_runtime_pm_enable(struct intel_runtime_pm *rpm);
 void intel_runtime_pm_disable(struct intel_runtime_pm *rpm);
-void intel_runtime_pm_cleanup(struct intel_runtime_pm *rpm);
+void intel_runtime_pm_driver_release(struct intel_runtime_pm *rpm);
 
 intel_wakeref_t intel_runtime_pm_get(struct intel_runtime_pm *rpm);
 intel_wakeref_t intel_runtime_pm_get_if_in_use(struct intel_runtime_pm *rpm);