Skip to content

Commit

Permalink
regulator: Handle missing constraints in _regulator_disable()
Browse files Browse the repository at this point in the history
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 Nov 16, 2009
1 parent a9366e6 commit 60ef66f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,8 @@ static int _regulator_disable(struct regulator_dev *rdev)
return -EIO;

/* are we the last user and permitted to disable ? */
if (rdev->use_count == 1 && !rdev->constraints->always_on) {
if (rdev->use_count == 1 &&
(rdev->constraints && !rdev->constraints->always_on)) {

/* we are last user */
if (_regulator_can_change_status(rdev) &&
Expand Down

0 comments on commit 60ef66f

Please sign in to comment.