Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252170
b: refs/heads/master
c: a4b4148
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Liam Girdwood committed May 27, 2011
1 parent 7b85578 commit 8fe5f5e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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: afdaaafe8e829364d9c1276b5435cc28ee5619df
refs/heads/master: a4b4148379ef1ad460fc1aa6bcf2cde99cd91166
16 changes: 13 additions & 3 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,16 +2097,26 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)

mutex_lock(&rdev->mutex);

/*
* first check to see if we can set modes at all, otherwise just
* tell the consumer everything is OK.
*/
regulator->uA_load = uA_load;
ret = regulator_check_drms(rdev);
if (ret < 0)
if (ret < 0) {
ret = 0;
goto out;
ret = -EINVAL;
}

/* sanity check */
if (!rdev->desc->ops->get_optimum_mode)
goto out;

/*
* we can actually do this so any errors are indicators of
* potential real failure.
*/
ret = -EINVAL;

/* get output voltage */
output_uV = _regulator_get_voltage(rdev);
if (output_uV <= 0) {
Expand Down

0 comments on commit 8fe5f5e

Please sign in to comment.