summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-07-28 00:01:30 +0100
committerMark Brown <broonie@kernel.org>2022-07-28 00:01:30 +0100
commitefc93392960cb9c3534e7aed15481ca7bcfdf15c (patch)
treeda57a38e15a939b3274e00282f0b0ddd7305e145 /drivers/regulator/core.c
parent9cc0590ae351a354c51375a1ee22edc2e4931fd0 (diff)
parent1de452a0edda26f1483d1d934f692eab13ba669a (diff)
regulator: Consumer load management improvements
Merge series from Douglas Anderson <dianders@chromium.org>: The main goal of this series is to make a small dent in cleaning up the way we deal with regulator loads. The idea is to add some extra functionality to the regulator "bulk" API so that consumers can specify the load using that.
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 398c8d6afd47..7150b1d0159e 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4784,22 +4784,26 @@ int regulator_bulk_get(struct device *dev, int num_consumers,
consumers[i].consumer = regulator_get(dev,
consumers[i].supply);
if (IS_ERR(consumers[i].consumer)) {
- ret = PTR_ERR(consumers[i].consumer);
consumers[i].consumer = NULL;
+ ret = dev_err_probe(dev, PTR_ERR(consumers[i].consumer),
+ "Failed to get supply '%s'",
+ consumers[i].supply);
goto err;
}
+
+ if (consumers[i].init_load_uA > 0) {
+ ret = regulator_set_load(consumers[i].consumer,
+ consumers[i].init_load_uA);
+ if (ret) {
+ i++;
+ goto err;
+ }
+ }
}
return 0;
err:
- if (ret != -EPROBE_DEFER)
- dev_err(dev, "Failed to get supply '%s': %pe\n",
- consumers[i].supply, ERR_PTR(ret));
- else
- dev_dbg(dev, "Failed to get supply '%s', deferring\n",
- consumers[i].supply);
-
while (--i >= 0)
regulator_put(consumers[i].consumer);