diff mbox

[2/4] regulator: Assume regulators are enabled if they don't report anything

Message ID e6c8fa2b9c4d8f3e09d7211bb81046a0102a0ac5.1272541613.git.mike@compulab.co.il
State Not Applicable
Delegated to: Amit Kucheria
Headers show

Commit Message

Mike Rapoport April 29, 2010, 12:08 p.m. UTC
From: Mark Brown <broonie@opensource.wolfsonmicro.com>

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>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
---
 drivers/regulator/core.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index b60a4c9..114a36d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1434,9 +1434,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);
 }