From 491a1323692230a78263553a6cee7f41a96463a0 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 19 Dec 2022 11:57:57 +0100 Subject: [PATCH] drivers: regulator: common: fix is_supported_voltage comparison The edge voltages within a range need to be included as part of the supported comparison. 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 3a39a7c8508..be456c33739 100644 --- a/drivers/regulator/regulator_common.c +++ b/drivers/regulator/regulator_common.c @@ -148,7 +148,7 @@ bool regulator_is_supported_voltage(const struct device *dev, int32_t min_uv, (void)regulator_list_voltage(dev, idx, &volt_uv); - if ((volt_uv > min_uv) && (volt_uv < max_uv)) { + if ((volt_uv >= min_uv) && (volt_uv <= max_uv)) { return true; } }