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>
This commit is contained in:
Claudiu Beznea 2020-11-13 19:56:04 +02:00 committed by Mark Brown
parent 2f595d0861
commit ab97800e08
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 3 additions and 0 deletions

View File

@ -4037,6 +4037,9 @@ int regulator_set_voltage_time(struct regulator *regulator,
if (i < rdev->desc->linear_min_sel) if (i < rdev->desc->linear_min_sel)
continue; continue;
if (old_sel >= 0 && new_sel >= 0)
break;
voltage = regulator_list_voltage(regulator, i); voltage = regulator_list_voltage(regulator, i);
if (voltage < 0) if (voltage < 0)
return -EINVAL; return -EINVAL;