From: Mark Brown Date: Tue, 13 Oct 2009 12:06:50 +0000 (+0100) Subject: regulator: Handle missing constraints in _regulator_disable() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=60ef66fcf40f0e7bc9579981aa16bd8218942a83;p=linux.git regulator: Handle missing constraints in _regulator_disable() Signed-off-by: Mark Brown Signed-off-by: Liam Girdwood --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 744ea1d0b59bf..efe568deda12b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -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) &&