diff options
author | Claudiu Beznea <claudiu.beznea@microchip.com> | 2020-11-13 19:56:04 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-11-13 18:02:07 +0000 |
commit | ab97800e088acf34d0014845ed93605dd5c1ea2a (patch) | |
tree | 6cd4fc2a7a42c6a81c867972143960e34cc2ec8f /drivers/regulator | |
parent | 2f595d08614691a2443987496995c24ff397abf9 (diff) | |
download | linux-ab97800e088acf34d0014845ed93605dd5c1ea2a.tar.gz linux-ab97800e088acf34d0014845ed93605dd5c1ea2a.tar.bz2 linux-ab97800e088acf34d0014845ed93605dd5c1ea2a.zip |
regulator: core: do not continue if selector match
Do not continue if selector has already been located.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/1605290164-11556-1-git-send-email-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 7de3df6bedbf..85bf278c9378 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -4037,6 +4037,9 @@ int regulator_set_voltage_time(struct regulator *regulator, if (i < rdev->desc->linear_min_sel) continue; + if (old_sel >= 0 && new_sel >= 0) + break; + voltage = regulator_list_voltage(regulator, i); if (voltage < 0) return -EINVAL; |