Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222785
b: refs/heads/master
c: f3c18a8
h: refs/heads/master
i:
  222783: 8e9b032
v: v3
  • Loading branch information
Bengt Jonsson authored and Liam Girdwood committed Nov 30, 2010
1 parent dc87582 commit 3d1076e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9e26bc804e611d879353cd953cb17db1c52d307
refs/heads/master: f3c18a87f3ddcfd31b16f689d01eb6adcc99de74
20 changes: 11 additions & 9 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1267,15 +1267,17 @@ static int _regulator_enable(struct regulator_dev *rdev)
{
int ret, delay;

/* do we need to enable the supply regulator first */
if (rdev->supply) {
mutex_lock(&rdev->supply->mutex);
ret = _regulator_enable(rdev->supply);
mutex_unlock(&rdev->supply->mutex);
if (ret < 0) {
printk(KERN_ERR "%s: failed to enable %s: %d\n",
__func__, rdev_get_name(rdev), ret);
return ret;
if (rdev->use_count == 0) {
/* do we need to enable the supply regulator first */
if (rdev->supply) {
mutex_lock(&rdev->supply->mutex);
ret = _regulator_enable(rdev->supply);
mutex_unlock(&rdev->supply->mutex);
if (ret < 0) {
printk(KERN_ERR "%s: failed to enable %s: %d\n",
__func__, rdev_get_name(rdev), ret);
return ret;
}
}
}

Expand Down

0 comments on commit 3d1076e

Please sign in to comment.