diff options
Diffstat (limited to 'include/linux/regulator/consumer.h')
-rw-r--r-- | include/linux/regulator/consumer.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 7bc732ce6e5..8f3063f458d 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -368,8 +368,11 @@ static inline int regulator_count_voltages(struct regulator *regulator) | |||
368 | static inline int regulator_set_voltage_tol(struct regulator *regulator, | 368 | static inline int regulator_set_voltage_tol(struct regulator *regulator, |
369 | int new_uV, int tol_uV) | 369 | int new_uV, int tol_uV) |
370 | { | 370 | { |
371 | return regulator_set_voltage(regulator, | 371 | if (regulator_set_voltage(regulator, new_uV, new_uV + tol_uV) == 0) |
372 | new_uV - tol_uV, new_uV + tol_uV); | 372 | return 0; |
373 | else | ||
374 | return regulator_set_voltage(regulator, | ||
375 | new_uV - tol_uV, new_uV + tol_uV); | ||
373 | } | 376 | } |
374 | 377 | ||
375 | static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, | 378 | static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, |