summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2016-01-12 18:26:02 +0000
committerMark Brown <broonie@kernel.org>2016-01-12 18:26:02 +0000
commit3ad4b0517b6510a53d791f9ead531a08bda3bcdd (patch)
tree83554b58757f943defafa6966b86ea3496f8883c
parent168309855a7d1e16db751e9c647119fe2d2dc878 (diff)
parentfa731ac7ea04a7d3a5c6d2f568132478c02a83b3 (diff)
Merge remote-tracking branch 'regulator/fix/core' into regulator-linus
-rw-r--r--drivers/regulator/core.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 73b7683355cd..c70017d5f74b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -138,18 +138,10 @@ static bool have_full_constraints(void)
*/
static void regulator_lock_supply(struct regulator_dev *rdev)
{
- struct regulator *supply;
- int i = 0;
-
- while (1) {
- mutex_lock_nested(&rdev->mutex, i++);
- supply = rdev->supply;
-
- if (!rdev->supply)
- return;
+ int i;
- rdev = supply->rdev;
- }
+ for (i = 0; rdev->supply; rdev = rdev->supply->rdev, i++)
+ mutex_lock_nested(&rdev->mutex, i);
}
/**