mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
regulator: fix voltage check in regulator_is_supported_voltage()
regulator_is_supported_voltage() should return true only if the voltage of fixed/constant regulator is between min_uV and max_uV. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
This commit is contained in:
parent
77b67063bb
commit
f0f98b19e2
1 changed files with 1 additions and 1 deletions
|
@ -1974,7 +1974,7 @@ int regulator_is_supported_voltage(struct regulator *regulator,
|
|||
if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
|
||||
ret = regulator_get_voltage(regulator);
|
||||
if (ret >= 0)
|
||||
return (min_uV >= ret && ret <= max_uV);
|
||||
return (min_uV <= ret && ret <= max_uV);
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue