diff options
author | Mark Brown <broonie@kernel.org> | 2022-07-28 02:01:30 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-07-28 02:01:30 +0300 |
commit | efc93392960cb9c3534e7aed15481ca7bcfdf15c (patch) | |
tree | da57a38e15a939b3274e00282f0b0ddd7305e145 /drivers/regulator/core.c | |
parent | 9cc0590ae351a354c51375a1ee22edc2e4931fd0 (diff) | |
parent | 1de452a0edda26f1483d1d934f692eab13ba669a (diff) | |
download | linux-efc93392960cb9c3534e7aed15481ca7bcfdf15c.tar.xz |
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.c | 20 |
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); |