diff options
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; } |