Skip to content

Commit

Permalink
regulator: core: Use map_voltage_linear() if list_voltage_linear() is…
Browse files Browse the repository at this point in the history
… in use and nothing is set

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jun 4, 2012
1 parent 3a4b0a0 commit 9152c36
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2118,12 +2118,18 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
ret = rdev->desc->ops->set_voltage(rdev, min_uV, max_uV,
&selector);
} else if (rdev->desc->ops->set_voltage_sel) {
if (rdev->desc->ops->map_voltage)
if (rdev->desc->ops->map_voltage) {
ret = rdev->desc->ops->map_voltage(rdev, min_uV,
max_uV);
else
ret = regulator_map_voltage_iterate(rdev, min_uV,
max_uV);
} else {
if (rdev->desc->ops->list_voltage ==
regulator_list_voltage_linear)
ret = regulator_map_voltage_linear(rdev,
min_uV, max_uV);
else
ret = regulator_map_voltage_iterate(rdev,
min_uV, max_uV);
}

if (ret >= 0) {
selector = ret;
Expand Down

0 comments on commit 9152c36

Please sign in to comment.