All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: Assume regulators are enabled if they don't report anything
@ 2010-02-11 17:22 Mark Brown
  2010-02-12 11:20 ` Liam Girdwood
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2010-02-11 17:22 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

If a regulator driver does not provide a way to query if the driver is
enabled then assume that it is enabled.  This is very likely to reflect
the actual state is more useful for callers than reporting an error.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 5a3509b..7f9177f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1466,9 +1466,9 @@ EXPORT_SYMBOL_GPL(regulator_force_disable);
 
 static int _regulator_is_enabled(struct regulator_dev *rdev)
 {
-	/* sanity check */
+	/* If we don't know then assume that the regulator is always on */
 	if (!rdev->desc->ops->is_enabled)
-		return -EINVAL;
+		return 1;
 
 	return rdev->desc->ops->is_enabled(rdev);
 }
-- 
1.6.6.1


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

* Re: [PATCH] regulator: Assume regulators are enabled if they don't report anything
  2010-02-11 17:22 [PATCH] regulator: Assume regulators are enabled if they don't report anything Mark Brown
@ 2010-02-12 11:20 ` Liam Girdwood
  0 siblings, 0 replies; 2+ messages in thread
From: Liam Girdwood @ 2010-02-12 11:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel

On Thu, 2010-02-11 at 17:22 +0000, Mark Brown wrote:
> If a regulator driver does not provide a way to query if the driver is
> enabled then assume that it is enabled.  This is very likely to reflect
> the actual state is more useful for callers than reporting an error.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---

Applied.

Thanks

Liam

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


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

end of thread, other threads:[~2010-02-12 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-11 17:22 [PATCH] regulator: Assume regulators are enabled if they don't report anything Mark Brown
2010-02-12 11:20 ` Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.