2010-08-18 03:34:55

by Axel Lin

[permalink] [raw]
Subject: [PATCH] regulator: max1586 - improve the logic of choosing selector

A little bit improvement in the logic of choosing selector.

Signed-off-by: Axel Lin <[email protected]>
---
drivers/regulator/max1586.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c
index 8867c27..559cfa2 100644
--- a/drivers/regulator/max1586.c
+++ b/drivers/regulator/max1586.c
@@ -121,14 +121,14 @@ static int max1586_v6_set(struct regulator_dev *rdev, int min_uV, int max_uV)
if (max_uV < MAX1586_V6_MIN_UV || max_uV > MAX1586_V6_MAX_UV)
return -EINVAL;

- if (min_uV >= 3000000)
- selector = 3;
- if (min_uV < 3000000)
- selector = 2;
- if (min_uV < 2500000)
- selector = 1;
if (min_uV < 1800000)
selector = 0;
+ else if (min_uV < 2500000)
+ selector = 1;
+ else if (min_uV < 3000000)
+ selector = 2;
+ else if (min_uV >= 3000000)
+ selector = 3;

if (max1586_v6_calc_voltage(selector) > max_uV)
return -EINVAL;
--
1.7.2



2010-08-18 08:42:24

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regulator: max1586 - improve the logic of choosing selector

On Wed, Aug 18, 2010 at 11:37:21AM +0800, Axel Lin wrote:
> A little bit improvement in the logic of choosing selector.
>
> Signed-off-by: Axel Lin <[email protected]>

Acked-by: Mark Brown <[email protected]>

2010-08-18 13:30:04

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH] regulator: max1586 - improve the logic of choosing selector

On Wed, 2010-08-18 at 09:42 +0100, Mark Brown wrote:
> On Wed, Aug 18, 2010 at 11:37:21AM +0800, Axel Lin wrote:
> > A little bit improvement in the logic of choosing selector.
> >
> > Signed-off-by: Axel Lin <[email protected]>
>
> Acked-by: Mark Brown <[email protected]>

Applied.

Thanks

Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

2010-08-18 18:04:27

by Robert Jarzmik

[permalink] [raw]
Subject: Re: [PATCH] regulator: max1586 - improve the logic of choosing selector

Axel Lin <[email protected]> writes:

> A little bit improvement in the logic of choosing selector.
Acked-by: Robert Jarzmik <[email protected]>

Cheers.

--
Robert