]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/regulator/core.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[mirror_ubuntu-bionic-kernel.git] / drivers / regulator / core.c
index 744ea1d0b59bf084f19559b8f199b644fbb0899c..efe568deda12b7710e882e07d81388af9053e484 100644 (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) &&