summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-12-11 20:44:49 +0000
committerMark Brown <broonie@kernel.org>2018-12-11 20:44:49 +0000
commite6202e8249aa7115af65f2d80b43c132816224ef (patch)
tree8865dd722ad55bb5e6bd5d446057395336ed0169 /drivers/regulator
parent2b96edb570709d6ca2e06842941c4bdf04b55f47 (diff)
parentd407c81adae57041ba82577e604e351f36b8afce (diff)
Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-4.21
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/bd718x7-regulator.c1
-rw-r--r--drivers/regulator/core.c22
2 files changed, 12 insertions, 11 deletions
diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
index e63581651d69..b8dcdc21dc22 100644
--- a/drivers/regulator/bd718x7-regulator.c
+++ b/drivers/regulator/bd718x7-regulator.c
@@ -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>
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 79cb090ff22f..ae0a559d1978 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1350,17 +1350,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
drms_uA_update(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);
@@ -1406,6 +1395,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;
}