summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>2020-06-12 12:23:17 +0300
committerMark Brown <broonie@kernel.org>2020-06-12 16:57:17 +0300
commit92919679d31721381e3c376488477efe49b915f3 (patch)
tree138e919cf8016ba10fa590c37b19536fed7c9aca /drivers/regulator
parentd7442ba13d62de9afc4e57344a676f9f4623dcaa (diff)
downloadlinux-92919679d31721381e3c376488477efe49b915f3.tar.xz
regulator: Fix pickable ranges mapping
Pickable ranges mapping function never used range min selector. Thus existing drivers broke when proper linear_ranges functionality was taken in use. Fix this for now just by ignoring the minimum selector. Fixes: 60ab7f4153b6 ("regulator: use linear_ranges helper") Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20200612090225.GA3243@localhost.localdomain Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/helpers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/helpers.c b/drivers/regulator/helpers.c
index e970e9d2f8be..e4bb09bbd3fa 100644
--- a/drivers/regulator/helpers.c
+++ b/drivers/regulator/helpers.c
@@ -486,7 +486,7 @@ int regulator_map_voltage_pickable_linear_range(struct regulator_dev *rdev,
continue;
}
- ret = selector + sel;
+ ret = selector + sel - range->min_sel;
voltage = rdev->desc->ops->list_voltage(rdev, ret);