summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-11-22 22:56:20 +0300
committerMark Brown <broonie@kernel.org>2019-11-22 22:56:20 +0300
commita21da94f617bce0771144ea8093b6987184b38d0 (patch)
treeca8fe8bcd71f07a9215e6ac3a584fc22a45a3d8b /drivers/regulator/core.c
parentc642e87086847d7f61b7b7d8744ac23e44cac91e (diff)
parentc15d5a645875bc9b89f68f5d3fb608f691ac78d7 (diff)
downloadlinux-a21da94f617bce0771144ea8093b6987184b38d0.tar.xz
Merge branch 'regulator-5.5' into regulator-next
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index df49f35ae20f..679ad3d2ed23 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1403,7 +1403,9 @@ static int set_machine_constraints(struct regulator_dev *rdev,
rdev_err(rdev, "failed to enable\n");
return ret;
}
- rdev->use_count++;
+
+ if (rdev->constraints->always_on)
+ rdev->use_count++;
}
print_constraints(rdev);
@@ -4967,6 +4969,12 @@ static int generic_coupler_attach(struct regulator_coupler *coupler,
return -EPERM;
}
+ if (!rdev->constraints->always_on) {
+ rdev_err(rdev,
+ "Coupling of a non always-on regulator is unimplemented\n");
+ return -ENOTSUPP;
+ }
+
return 0;
}