提交 9152c36a 编写于 作者: A Axel Lin 提交者: Mark Brown

regulator: core: Use map_voltage_linear() if list_voltage_linear() is in use and nothing is set

Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 3a4b0a07
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册