* [PATCH] regulator: core: Silence EPROBE_DEFER error on bulk_get
@ 2015-02-26 23:40 Bjorn Andersson
2015-03-05 0:06 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Andersson @ 2015-02-26 23:40 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: linux-kernel
As this is already being logged elsewhere we shouldn't spam the log
unnecessarily upon EPROBE_DEFER.
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---
Maybe we should have a dev_dbg() for EPROBE_DEFER to aid finding which
regulator it actually was that it deferred?
drivers/regulator/core.c | 5 +++--
drivers/regulator/devres.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 5467744..4429788 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3148,8 +3148,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;
}
diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
index 8f785bc..7cb9e01 100644
--- a/drivers/regulator/devres.c
+++ b/drivers/regulator/devres.c
@@ -168,8 +168,9 @@ int devm_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;
}
--
1.8.2.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: core: Silence EPROBE_DEFER error on bulk_get
2015-02-26 23:40 [PATCH] regulator: core: Silence EPROBE_DEFER error on bulk_get Bjorn Andersson
@ 2015-03-05 0:06 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-03-05 0:06 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: Liam Girdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]
On Thu, Feb 26, 2015 at 03:40:20PM -0800, Bjorn Andersson wrote:
> As this is already being logged elsewhere we shouldn't spam the log
> unnecessarily upon EPROBE_DEFER.
Where exactly is this "elsewhere" you're thinking of? I suspect you
mean the core -EPROBE_DEFER logging but you don't say...
> Maybe we should have a dev_dbg() for EPROBE_DEFER to aid finding which
> regulator it actually was that it deferred?
No, that's the wrong way around:
> 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);
What you're saying here is that essentially everything in the probe path
has to special case -EPROBE_DEFER to remove error logging which in turn
means that any useful information gets elided from the logs. Having a
debug level log that people can enable or dig out helps somewhat but
it's not really helping users to make it harder to discover information.
If you think probe deferral is too noisy then fix it, don't go and add
lots of special casing code to the error handling. If other things
aren't reporting errors well then fix that.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-05 0:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-26 23:40 [PATCH] regulator: core: Silence EPROBE_DEFER error on bulk_get Bjorn Andersson
2015-03-05 0:06 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®