summaryrefslogtreecommitdiffstats
path: root/include/linux/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-09-01 13:50:06 +0100
committerMark Brown <broonie@linaro.org>2013-09-01 13:50:06 +0100
commit1ad13028e55847185646b2be7d8b86b311c33249 (patch)
tree59e30b76948b0031777886ca1e3425205ae08de5 /include/linux/regulator
parent5288be36cd40d2b830c4165cf1a9c15631eae250 (diff)
parent84fcf447a99c8cc9cc906b42e590d1a3a7ed56ab (diff)
downloadop-kernel-dev-1ad13028e55847185646b2be7d8b86b311c33249.zip
op-kernel-dev-1ad13028e55847185646b2be7d8b86b311c33249.tar.gz
Merge remote-tracking branch 'regulator/topic/core' into regulator-next
Diffstat (limited to 'include/linux/regulator')
-rw-r--r--include/linux/regulator/consumer.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 3a76389..3610df8 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -369,8 +369,11 @@ static inline int regulator_count_voltages(struct regulator *regulator)
static inline int regulator_set_voltage_tol(struct regulator *regulator,
int new_uV, int tol_uV)
{
- return regulator_set_voltage(regulator,
- new_uV - tol_uV, new_uV + tol_uV);
+ if (regulator_set_voltage(regulator, new_uV, new_uV + tol_uV) == 0)
+ return 0;
+ else
+ return regulator_set_voltage(regulator,
+ new_uV - tol_uV, new_uV + tol_uV);
}
static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
OpenPOWER on IntegriCloud