]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/core.c
Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / drivers / regulator / core.c
index df49f35ae20f38f8eb7df373e2c3861b47552b9d..679ad3d2ed23dad04fa8d655965b968a5ea1644e 100644 (file)
@@ -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;
 }