diff options
author | 2019-11-22 19:56:20 +0000 | |
---|---|---|
committer | 2019-11-22 19:56:20 +0000 | |
commit | a21da94f617bce0771144ea8093b6987184b38d0 (patch) | |
tree | ca8fe8bcd71f07a9215e6ac3a584fc22a45a3d8b /drivers/regulator/core.c | |
parent | Merge branch 'regulator-5.4' into regulator-linus (diff) | |
parent | regulator: da9062: Return REGULATOR_MODE_INVALID for invalid mode (diff) | |
download | wireguard-linux-a21da94f617bce0771144ea8093b6987184b38d0.tar.xz wireguard-linux-a21da94f617bce0771144ea8093b6987184b38d0.zip |
Merge branch 'regulator-5.5' into regulator-next
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 10 |
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; } |