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 <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-12-19 11:57:57 +01:00 committed by Fabio Baltieri
parent 7eb97639ef
commit 491a132369

View file

@ -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;
}
}