Skip to content

Commit

Permalink
regulator: Assume regulators are enabled if they don't report anything
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Mar 3, 2010
1 parent 17133dc commit 9a7f6a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9a7f6a4

Please sign in to comment.