mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
regulator: core: Fix logic to determinate if regulator can change voltage
Having a linear_min_sel setting means the first linear_min_sel selectors are invalid. We need to subtract linear_min_sel when use n_voltages to determinate if regulator can change voltage. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
b17fc86cc5
commit
8a23b4e03d
1 changed files with 1 additions and 1 deletions
|
|
@ -1881,7 +1881,7 @@ int regulator_can_change_voltage(struct regulator *regulator)
|
|||
|
||||
if (rdev->constraints &&
|
||||
rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE &&
|
||||
rdev->desc->n_voltages > 1)
|
||||
(rdev->desc->n_voltages - rdev->desc->linear_min_sel) > 1)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue