summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-02-11 17:22:45 +0000
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-02-12 11:09:52 +0000
commit9e62957b7ed0ddc8d846591dc6b1bb5474f630c3 (patch)
treeb070c1faa5ea5d9f7ce45f87575715dbb675ad28 /drivers/regulator
parent11fa3fbd46e822216b1a2368a96e379155559d79 (diff)
regulator: Assume regulators are enabled if they don't report anything
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 5a3509b835f4..7f9177fd31d9 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);
}