Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312480
b: refs/heads/master
c: c5f3939
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown committed Jul 3, 2012
1 parent e9f04db commit bde6ae6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4fe23791a4052ad4c8ba79dab9ff5febc8095714
refs/heads/master: c5f3939b8fe0c358d35397982e5afdef112afc81
10 changes: 10 additions & 0 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,8 +1890,18 @@ EXPORT_SYMBOL_GPL(regulator_list_voltage);
int regulator_is_supported_voltage(struct regulator *regulator,
int min_uV, int max_uV)
{
struct regulator_dev *rdev = regulator->rdev;
int i, voltages, ret;

/* If we can't change voltage check the current voltage */
if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
ret = regulator_get_voltage(regulator);
if (ret >= 0)
return (min_uV >= ret && ret <= max_uV);
else
return ret;
}

ret = regulator_count_voltages(regulator);
if (ret < 0)
return ret;
Expand Down

0 comments on commit bde6ae6

Please sign in to comment.