Skip to content

Commit

Permalink
Merge remote-tracking branch 'regulator/fix/core' into regulator-linus
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Brown committed Sep 21, 2015
2 parents 1f93e4a + 23c3f31 commit 4e2e986
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,15 +1394,15 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
return 0;

r = regulator_dev_lookup(dev, rdev->supply_name, &ret);
if (ret == -ENODEV) {
/*
* No supply was specified for this regulator and
* there will never be one.
*/
return 0;
}

if (!r) {
if (ret == -ENODEV) {
/*
* No supply was specified for this regulator and
* there will never be one.
*/
return 0;
}

if (have_full_constraints()) {
r = dummy_regulator_rdev;
} else {
Expand All @@ -1422,11 +1422,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
return ret;

/* Cascade always-on state to supply */
if (_regulator_is_enabled(rdev)) {
if (_regulator_is_enabled(rdev) && rdev->supply) {
ret = regulator_enable(rdev->supply);
if (ret < 0) {
if (rdev->supply)
_regulator_put(rdev->supply);
_regulator_put(rdev->supply);
return ret;
}
}
Expand Down

0 comments on commit 4e2e986

Please sign in to comment.