[PATCH 2/2] regulator: Handle missing constraints in _regulator_disable()

From: Mark Brown
Date: Tue Oct 13 2009 - 08:08:21 EST


Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
drivers/regulator/core.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 25e35c7..1ac37f5 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1289,7 +1289,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) &&
--
1.6.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/