regulator: Handle missing constraints in _regulator_disable()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
Mark Brown 2009-10-13 13:06:50 +01:00 committed by Liam Girdwood
parent a9366e61b0
commit 60ef66fcf4

View File

@ -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) &&