Merge branch 'regulator-4.20' into regulator-linus
authorMark Brown <broonie@kernel.org>
Tue, 11 Dec 2018 01:17:23 +0000 (01:17 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 11 Dec 2018 01:17:23 +0000 (01:17 +0000)
drivers/regulator/bd718x7-regulator.c
drivers/regulator/core.c
include/linux/regulator/consumer.h

index 3a47e0372e77c81248efc6bf04e7fb832d5b59ac..7ba14dae5848df9363a4c47b0b28de32dac15013 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/mfd/rohm-bd718x7.h>
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
index 2c66b528aedec02f4afdda7e8c04faf60711a70d..6e146102fd938b9cee6a34e52511f1819bed76f1 100644 (file)
@@ -1158,17 +1158,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
                }
        }
 
-       /* If the constraints say the regulator should be on at this point
-        * and we have control then make sure it is enabled.
-        */
-       if (rdev->constraints->always_on || rdev->constraints->boot_on) {
-               ret = _regulator_do_enable(rdev);
-               if (ret < 0 && ret != -EINVAL) {
-                       rdev_err(rdev, "failed to enable\n");
-                       return ret;
-               }
-       }
-
        if ((rdev->constraints->ramp_delay || rdev->constraints->ramp_disable)
                && ops->set_ramp_delay) {
                ret = ops->set_ramp_delay(rdev, rdev->constraints->ramp_delay);
@@ -1214,6 +1203,17 @@ static int set_machine_constraints(struct regulator_dev *rdev,
                }
        }
 
+       /* If the constraints say the regulator should be on at this point
+        * and we have control then make sure it is enabled.
+        */
+       if (rdev->constraints->always_on || rdev->constraints->boot_on) {
+               ret = _regulator_do_enable(rdev);
+               if (ret < 0 && ret != -EINVAL) {
+                       rdev_err(rdev, "failed to enable\n");
+                       return ret;
+               }
+       }
+
        print_constraints(rdev);
        return 0;
 }
index 25602afd48447f3c410f79082e966b1d4589d911..f3f76051e8b008346a0e7acd4b6512d7ecef85f3 100644 (file)
@@ -508,7 +508,7 @@ static inline int regulator_get_error_flags(struct regulator *regulator,
 
 static inline int regulator_set_load(struct regulator *regulator, int load_uA)
 {
-       return REGULATOR_MODE_NORMAL;
+       return 0;
 }
 
 static inline int regulator_allow_bypass(struct regulator *regulator,