Skip to content

Commit

Permalink
regulator: Fix pickable ranges mapping
Browse files Browse the repository at this point in the history
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: 60ab7f4 ("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>
  • Loading branch information
Matti Vaittinen authored and Mark Brown committed Jun 12, 2020
1 parent d7442ba commit 9291967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 9291967

Please sign in to comment.