summaryrefslogtreecommitdiffstats
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-03-03 14:49:26 +0000
commit9a7f6a4c6edc84748c6477c9df56691a0e61b8fd (patch)
treee58dc062e3943bbc209eb65e6484010f99db6dc2 /drivers/regulator
parent17133dc82422cb118c843c3e9bbd565c37506ec8 (diff)
downloadlinux-9a7f6a4c6edc84748c6477c9df56691a0e61b8fd.tar.bz2
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 ca8e1642538b..75a26f780918 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);
}