[PATCH] regulator: core: Quiet -EPROBE_DEFER from regulator_bulk_get()

From: Douglas Anderson
Date: Mon May 14 2018 - 18:40:53 EST


The -EPROBE_DEFER virus demands special case code to avoid printing
error messages when the error is only -EPROBE_DEFER. Spread the virus
to a new host: regulator_bulk_get()

Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
---

drivers/regulator/core.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d4803460a557..42e97fb85e95 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3696,8 +3696,9 @@ int regulator_bulk_get(struct device *dev, int num_consumers,
consumers[i].supply);
if (IS_ERR(consumers[i].consumer)) {
ret = PTR_ERR(consumers[i].consumer);
- dev_err(dev, "Failed to get supply '%s': %d\n",
- consumers[i].supply, ret);
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "Failed to get supply '%s': %d\n",
+ consumers[i].supply, ret);
consumers[i].consumer = NULL;
goto err;
}
--
2.17.0.441.gb46fe60e1d-goog