drivers: regulator: fix is_supported_voltage return code

If a voltage is not supported we need to return false, not a negative
errno.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-12-19 13:30:51 +01:00 committed by Fabio Baltieri
commit 2b6a211946

View file

@ -138,7 +138,7 @@ bool regulator_is_supported_voltage(const struct device *dev, int32_t min_uv,
/* voltage may not be allowed, even if supported */
if ((min_uv < config->min_uv) || (max_uv > config->max_uv)) {
return -EINVAL;
return false;
}
volt_cnt = regulator_count_voltages(dev);