FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

LinkBack Thread Tools
Old 04-29-2010, 12:08 PM
Mike Rapoport
Default regulator: Assume regulators are enabled if they don't report anything

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 --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);

kernel-team mailing list

Thread Tools

All times are GMT. The time now is 12:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org