浏览代码

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>
Mark Brown 15 年之前
父节点
当前提交
60ef66fcf4
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/regulator/core.c

+ 2 - 1
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) &&