Re: [PATCH] regulator: core: Silence EPROBE_DEFER error on bulk_get

From: Mark Brown
Date: Wed Mar 04 2015 - 19:06:30 EST


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: signature.asc
Description: Digital signature