summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-15 01:38:27 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-01-15 01:38:27 +0100
commita1ed63f4db7f7734dfed8d158eddd3cdeda771fa (patch)
tree85b1937008b8017d18ffa6fa245516b4a020f488 /drivers
parentLinux 3.8-rc3 (diff)
parentregulator: core: Fix comment for regulator_register() (diff)
downloadlinux-a1ed63f4db7f7734dfed8d158eddd3cdeda771fa.tar.xz
linux-a1ed63f4db7f7734dfed8d158eddd3cdeda771fa.zip
Merge remote-tracking branch 'regulator/fix/core' into tmp
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/core.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 0f65b246cc0c..278584302f2d 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,