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

regulator: Set delay to 0 if set_voltage_time_sel callback returns error

rdev->desc->ops->set_voltage_time_sel may return negative error code.
Set delay to 0 and also show warning if set_voltage_time_sel returns error.
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 24751434
...@@ -1836,8 +1836,12 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, ...@@ -1836,8 +1836,12 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
if (ret < 0) if (ret < 0)
return ret; return ret;
old_selector = ret; old_selector = ret;
delay = rdev->desc->ops->set_voltage_time_sel(rdev, ret = rdev->desc->ops->set_voltage_time_sel(rdev,
old_selector, selector); old_selector, selector);
if (ret < 0)
rdev_warn(rdev, "set_voltage_time_sel() failed: %d\n", ret);
else
delay = ret;
} }
if (best_val != INT_MAX) { if (best_val != INT_MAX) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册