public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] REGULATOR Handle positive returncode from enable
@ 2009-08-26 10:54 Linus Walleij
  2009-08-26 12:01 ` Mark Brown
  2009-08-26 15:22 ` Liam Girdwood
  0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2009-08-26 10:54 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, Linus Walleij

This makes _regulator_enable() properly handle the case where
a regulator is already on when you try to enable it. Currently
it will erroneously handle positive return values as an error.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/regulator/core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index dbf27bf..744ea1d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1236,11 +1236,12 @@ static int _regulator_enable(struct regulator_dev *rdev)
 			} else {
 				return -EINVAL;
 			}
-		} else {
+		} else if (ret < 0) {
 			printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
 			       __func__, rdev->desc->name, ret);
 			return ret;
 		}
+		/* Fallthrough on positive return values - already enabled */
 	}
 
 	rdev->use_count++;
-- 
1.6.2.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] REGULATOR Handle positive returncode from enable
  2009-08-26 10:54 [PATCH] REGULATOR Handle positive returncode from enable Linus Walleij
@ 2009-08-26 12:01 ` Mark Brown
  2009-08-26 15:22 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-08-26 12:01 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Liam Girdwood, linux-kernel

On Wed, Aug 26, 2009 at 12:54:04PM +0200, Linus Walleij wrote:
> This makes _regulator_enable() properly handle the case where
> a regulator is already on when you try to enable it. Currently
> it will erroneously handle positive return values as an error.
> 
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] REGULATOR Handle positive returncode from enable
  2009-08-26 10:54 [PATCH] REGULATOR Handle positive returncode from enable Linus Walleij
  2009-08-26 12:01 ` Mark Brown
@ 2009-08-26 15:22 ` Liam Girdwood
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2009-08-26 15:22 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Mark Brown, linux-kernel

On Wed, 2009-08-26 at 12:54 +0200, Linus Walleij wrote:
> This makes _regulator_enable() properly handle the case where
> a regulator is already on when you try to enable it. Currently
> it will erroneously handle positive return values as an error.
> 
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
>  drivers/regulator/core.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 

Applied.

Thanks

Liam


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-26 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 10:54 [PATCH] REGULATOR Handle positive returncode from enable Linus Walleij
2009-08-26 12:01 ` Mark Brown
2009-08-26 15:22 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox