aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-12-11 07:36:37 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-11 07:44:23 -0500
commit8a23b4e03d6873ec50f7d212de78ff01e393fc1a (patch)
tree4cedde456bb56b1745eebdc2ebfa68b39cc1c998 /drivers/regulator
parentb17fc86cc5e8fbfd1d18765f6463d1989c59f9c6 (diff)
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 <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 1c8ff8ce5c57..f3cdfe5810cc 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1881,7 +1881,7 @@ int regulator_can_change_voltage(struct regulator *regulator)
1881 1881
1882 if (rdev->constraints && 1882 if (rdev->constraints &&
1883 rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE && 1883 rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE &&
1884 rdev->desc->n_voltages > 1) 1884 (rdev->desc->n_voltages - rdev->desc->linear_min_sel) > 1)
1885 return 1; 1885 return 1;
1886 1886
1887 return 0; 1887 return 0;