[PATCH] drm/i915: initialize uncore->lock in uncore_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now that all the uncore management is hidden under the uncore struct,
move the lock initialization under the uncore_init as well for better
encapsulation.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx>
Cc: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/i915_drv.c     | 1 -
 drivers/gpu/drm/i915/intel_uncore.c | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 0ca57dc5da5c..667177b7d821 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -873,7 +873,6 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv)
 	spin_lock_init(&dev_priv->irq_lock);
 	spin_lock_init(&dev_priv->gpu_error.lock);
 	mutex_init(&dev_priv->backlight_lock);
-	spin_lock_init(&dev_priv->uncore.lock);
 
 	mutex_init(&dev_priv->sb_lock);
 	mutex_init(&dev_priv->av_mutex);
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index 106df24f20a5..250496f792e5 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -1530,6 +1530,8 @@ int intel_uncore_init(struct intel_uncore *uncore)
 	struct drm_i915_private *i915 = uncore_to_i915(uncore);
 	int ret;
 
+	spin_lock_init(&uncore->lock);
+
 	ret = uncore_mmio_setup(uncore);
 	if (ret)
 		return ret;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux