diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-26 11:16:58 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-26 11:53:35 +0100 |
commit | 5aff3a8b20c54888e199e863744848007f1f4120 (patch) | |
tree | 507c5e74cce81ad18734199a9d3516b4c82381f8 /drivers/regulator/core.c | |
parent | 08aed2f6fb09c9f8efc9258c152072ed614db226 (diff) | |
download | op-kernel-dev-5aff3a8b20c54888e199e863744848007f1f4120.zip op-kernel-dev-5aff3a8b20c54888e199e863744848007f1f4120.tar.gz |
regulator: core: Check for failed voltage sets before checking for delay
There is no need to consider waiting for the voltage to ramp if we
didn't manage to set it and looking at the return value is going to be
cheaper than is_enabled().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 729b20d..890fa5e 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2143,7 +2143,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, best_val = _regulator_get_voltage(rdev); /* Call set_voltage_time_sel if successfully obtained old_selector */ - if (_regulator_is_enabled(rdev) && ret == 0 && old_selector >= 0 && + if (ret == 0 && _regulator_is_enabled(rdev) && old_selector >= 0 && rdev->desc->ops->set_voltage_time_sel) { delay = rdev->desc->ops->set_voltage_time_sel(rdev, |