To simplify i915_driver_unregister() code, make sure reverts of driver
registration steps executed before potentially unsuccessful device
registration are symmetrically called after drm_dev_unplug(). There is
one case that doesn't follow that rule, introduced by commit b46a33e271ed
("drm/i915/pmu: Expose a PMU interface for perf queries"), with no
justification for asymmetry provided in commit description, then assumed
not intentional.
Cc: Chris Wilson <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Signed-off-by: Janusz Krzysztofik <[email protected]>
---
drivers/gpu/drm/i915/i915_driver.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_driver.c
b/drivers/gpu/drm/i915/i915_driver.c
index d865e90f54704..7980bb880c7dc 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -689,20 +689,17 @@ static void i915_driver_unregister(struct
drm_i915_private *dev_priv)
intel_gt_driver_unregister(gt);
if (!dev_priv->do_unregister)
- goto do_pmu;
+ goto do_unplug;
i915_hwmon_unregister(dev_priv);
i915_perf_unregister(dev_priv);
-do_pmu:
- i915_pmu_unregister(dev_priv);
- if (!dev_priv->do_unregister)
- goto do_unplug;
i915_teardown_sysfs(dev_priv);
do_unplug:
drm_dev_unplug(&dev_priv->drm);
+ i915_pmu_unregister(dev_priv);
i915_gem_driver_unregister(dev_priv);
}
--
2.48.1