diff options
author | Philip Rakity <prakity@marvell.com> | 2012-06-14 22:07:56 (GMT) |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-17 19:50:26 (GMT) |
commit | 8b96de31b0cf190fb6b21c4ab1ce310c430b72ae (patch) | |
tree | d767e858ef463e18e24f158b91223e0d9cdb7f1c /drivers/regulator | |
parent | 2f7baf89d3e4ed787989168cf31f2fdc04067586 (diff) | |
download | linux-fsl-qoriq-8b96de31b0cf190fb6b21c4ab1ce310c430b72ae.tar.xz |
regulator: core.c Only delay when setting voltage requires this
minor optimization: move delay code to where delay is set and
thus where it is used vs in the main line path.
Signed-off-by: Philip Rakity <prakity@marvell.com>
Acked-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ebdd9e0..663ebd5 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2155,14 +2155,14 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, delay); delay = 0; } - } - /* Insert any necessary delays */ - if (delay >= 1000) { - mdelay(delay / 1000); - udelay(delay % 1000); - } else if (delay) { - udelay(delay); + /* Insert any necessary delays */ + if (delay >= 1000) { + mdelay(delay / 1000); + udelay(delay % 1000); + } else if (delay) { + udelay(delay); + } } if (ret == 0 && best_val >= 0) |