projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e18a0d0
)
Revert "UPSTREAM: regulator: core: avoid unused variable warning"
author
Huang, Tao
<huangtao@rock-chips.com>
Tue, 8 Mar 2016 08:13:26 +0000
(16:13 +0800)
committer
Gerrit Code Review
<gerrit@rock-chips.com>
Tue, 8 Mar 2016 08:27:08 +0000
(16:27 +0800)
This reverts commit
40e4c3535811ea74490bfa4fbe09cf85bb305efb
.
Please refer to commit
70a7fb80e85a
("regulator: core: Fix nested locking of supplies")
Change-Id: If0bee255621a7480cfc6fa232f65081c4d904897
drivers/regulator/core.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index c70017d5f74bb2d1305eb5d3f35a2885fbf9b51f..73b7683355cd015791114249defc26fdf2b644cf 100644
(file)
--- a/
drivers/regulator/core.c
+++ b/
drivers/regulator/core.c
@@
-138,10
+138,18
@@
static bool have_full_constraints(void)
*/
static void regulator_lock_supply(struct regulator_dev *rdev)
{
- int i;
+ struct regulator *supply;
+ int i = 0;
+
+ while (1) {
+ mutex_lock_nested(&rdev->mutex, i++);
+ supply = rdev->supply;
- for (i = 0; rdev->supply; rdev = rdev->supply->rdev, i++)
- mutex_lock_nested(&rdev->mutex, i);
+ if (!rdev->supply)
+ return;
+
+ rdev = supply->rdev;
+ }
}
/**