diff options
| author | Olof Johansson <olof@lixom.net> | 2013-01-27 22:07:11 -0800 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2013-01-27 22:07:20 -0800 |
| commit | 6b914c998787d65022e80d6262dfd0edef58cadb (patch) | |
| tree | ec9d9605ae08e6e40664c4302a181979ab4fe1d3 /drivers/regulator/core.c | |
| parent | 1f87a404d02a96519284e1928445ca5cfe9667db (diff) | |
| parent | 949db153b6466c6f7cad5a427ecea94985927311 (diff) | |
| download | olio-linux-3.10-6b914c998787d65022e80d6262dfd0edef58cadb.tar.xz olio-linux-3.10-6b914c998787d65022e80d6262dfd0edef58cadb.zip | |
Merge tag 'v3.8-rc5' into next/cleanup
Linux 3.8-rc5
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/regulator/core.c')
| -rw-r--r-- | drivers/regulator/core.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 0f65b246cc0..278584302f2 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1885,9 +1885,15 @@ int regulator_can_change_voltage(struct regulator *regulator) struct regulator_dev *rdev = regulator->rdev; if (rdev->constraints && - rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE && - (rdev->desc->n_voltages - rdev->desc->linear_min_sel) > 1) - return 1; + (rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { + if (rdev->desc->n_voltages - rdev->desc->linear_min_sel > 1) + return 1; + + if (rdev->desc->continuous_voltage_range && + rdev->constraints->min_uV && rdev->constraints->max_uV && + rdev->constraints->min_uV != rdev->constraints->max_uV) + return 1; + } return 0; } @@ -3315,7 +3321,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev) * @config: runtime configuration for regulator * * Called by regulator drivers to register a regulator. - * Returns 0 on success. + * Returns a valid pointer to struct regulator_dev on success + * or an ERR_PTR() on error. */ struct regulator_dev * regulator_register(const struct regulator_desc *regulator_desc, |