[PATCH 3/4] drm/i915: use for_each_power_well in lookup_power_well()

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

 



Use the nice helper function to make the implementation simpler.

Cc: Imre Deak <imre.deak@xxxxxxxxx>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@xxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_runtime_pm.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
index 2fdb1f4125c2..eabf98d153f7 100644
--- a/drivers/gpu/drm/i915/intel_runtime_pm.c
+++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
@@ -1109,16 +1109,11 @@ static struct i915_power_well *
 lookup_power_well(struct drm_i915_private *dev_priv,
 		  enum i915_power_well_id power_well_id)
 {
-	struct i915_power_domains *power_domains = &dev_priv->power_domains;
-	int i;
-
-	for (i = 0; i < power_domains->power_well_count; i++) {
-		struct i915_power_well *power_well;
+	struct i915_power_well *power_well;
 
-		power_well = &power_domains->power_wells[i];
+	for_each_power_well(dev_priv, power_well)
 		if (power_well->desc->id == power_well_id)
 			return power_well;
-	}
 
 	/* Tried to lookup a power well that doesn't exist for the platform. */
 	BUG();
-- 
2.14.4

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




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

  Powered by Linux