Commit 49820944 authored by Jorge Ramirez-Ortiz's avatar Jorge Ramirez-Ortiz Committed by Mark Brown

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: default avatarJorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent fd2f02f9
...@@ -3002,7 +3002,7 @@ EXPORT_SYMBOL_GPL(regulator_get_linear_step); ...@@ -3002,7 +3002,7 @@ EXPORT_SYMBOL_GPL(regulator_get_linear_step);
* @min_uV: Minimum required voltage in uV. * @min_uV: Minimum required voltage in uV.
* @max_uV: Maximum required voltage in uV. * @max_uV: Maximum required voltage in uV.
* *
* Returns a boolean or a negative error code. * Returns a boolean.
*/ */
int regulator_is_supported_voltage(struct regulator *regulator, int regulator_is_supported_voltage(struct regulator *regulator,
int min_uV, int max_uV) int min_uV, int max_uV)
...@@ -3026,7 +3026,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, ...@@ -3026,7 +3026,7 @@ int regulator_is_supported_voltage(struct regulator *regulator,
ret = regulator_count_voltages(regulator); ret = regulator_count_voltages(regulator);
if (ret < 0) if (ret < 0)
return ret; return 0;
voltages = ret; voltages = ret;
for (i = 0; i < voltages; i++) { for (i = 0; i < voltages; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment