diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-02-24 23:13:19 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-24 15:21:47 +0000 |
commit | 073512336e6333ffcaabbb2b92f8e616db3a0789 (patch) | |
tree | 280e7e61ca080acb02fa1d92403c2f85989f253d /drivers/regulator/core.c | |
parent | 247514344492a0cf602317d2089bab1301922624 (diff) | |
download | linux-stable-073512336e6333ffcaabbb2b92f8e616db3a0789.tar.gz linux-stable-073512336e6333ffcaabbb2b92f8e616db3a0789.tar.bz2 linux-stable-073512336e6333ffcaabbb2b92f8e616db3a0789.zip |
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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 603e39f81ce0..b97c4a256636 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1836,8 +1836,12 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, 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) { |