From 2b6a211946e2541906691e1eadf272b1e0c4078a Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 19 Dec 2022 13:30:51 +0100 Subject: [PATCH] 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 --- drivers/regulator/regulator_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/regulator_common.c b/drivers/regulator/regulator_common.c index be456c33739..84ab8c6161d 100644 --- a/drivers/regulator/regulator_common.c +++ b/drivers/regulator/regulator_common.c @@ -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);