dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Philip Rakity 2012-06-14 15:07:56 -07:00 committed by Mark Brown
parent 2f7baf89d3
commit 8b96de31b0
1 changed files with 7 additions and 7 deletions

View File

@ -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)