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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
if (ret < 0)
return 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);
+ if (ret < 0)
+ rdev_warn(rdev, "set_voltage_time_sel() failed: %d\n", ret);
+ else
+ delay = ret;
}
if (best_val != INT_MAX) {