diff options
Diffstat (limited to 'include/linux')
| -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 3a76389c6aaa..3610df8dd229 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) | |||
| 369 | static inline int regulator_set_voltage_tol(struct regulator *regulator, | 369 | static inline int regulator_set_voltage_tol(struct regulator *regulator, |
| 370 | int new_uV, int tol_uV) | 370 | int new_uV, int tol_uV) |
| 371 | { | 371 | { |
| 372 | return regulator_set_voltage(regulator, | 372 | if (regulator_set_voltage(regulator, new_uV, new_uV + tol_uV) == 0) |
| 373 | new_uV - tol_uV, new_uV + tol_uV); | 373 | return 0; |
| 374 | else | ||
| 375 | return regulator_set_voltage(regulator, | ||
| 376 | new_uV - tol_uV, new_uV + tol_uV); | ||
| 374 | } | 377 | } |
| 375 | 378 | ||
| 376 | static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, | 379 | static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, |
