2012-06-14 22:08:05

by Philip Rakity

[permalink] [raw]
Subject: [PATCH 2/2] 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 <[email protected]>
---
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 5b04916..4407ed2 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2166,14 +2166,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)
--
1.7.0.4


2012-06-15 11:20:20

by Axel Lin

[permalink] [raw]
Subject: Re: [PATCH 2/2] regulator: core.c Only delay when setting voltage requires this

2012/6/15 Philip Rakity <[email protected]>:
> 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 <[email protected]>
Acked-by: Axel Lin <[email protected]>

2012-06-17 19:50:41

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 2/2] regulator: core.c Only delay when setting voltage requires this

On Thu, Jun 14, 2012 at 03:07:56PM -0700, Philip Rakity wrote:
> minor optimization: move delay code to where delay is set and
> thus where it is used vs in the main line path.

Applied, thanks.


Attachments:
(No filename) (195.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments