Skip to content

Commit 4982094

Browse files
ldtsbroonie
authored andcommitted
regulator: core: simplify return value on suported_voltage
All the current clients of this API assume that 0 corresponds to a failure and non-zero to a pass therefore ignoring the need to handle a negative error code. This commit modifies the API to follow that standard since returning a negative (EINVAL) doesn't seem to provide enough value to justify the need to handle it. Signed-off-by: Jorge Ramirez-Ortiz <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent fd2f02f commit 4982094

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/regulator/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,7 +3002,7 @@ EXPORT_SYMBOL_GPL(regulator_get_linear_step);
30023002
* @min_uV: Minimum required voltage in uV.
30033003
* @max_uV: Maximum required voltage in uV.
30043004
*
3005-
* Returns a boolean or a negative error code.
3005+
* Returns a boolean.
30063006
*/
30073007
int regulator_is_supported_voltage(struct regulator *regulator,
30083008
int min_uV, int max_uV)
@@ -3026,7 +3026,7 @@ int regulator_is_supported_voltage(struct regulator *regulator,
30263026

30273027
ret = regulator_count_voltages(regulator);
30283028
if (ret < 0)
3029-
return ret;
3029+
return 0;
30303030
voltages = ret;
30313031

30323032
for (i = 0; i < voltages; i++) {

0 commit comments

Comments
 (0)