Skip to content

Commit

Permalink
regulator: core.c Only delay when setting voltage requires this
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Philip Rakity authored and Mark Brown committed Jun 17, 2012
1 parent 2f7baf8 commit 8b96de3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8b96de3

Please sign in to comment.