* [PATCH] regulator: anatop: Drop error message for -EPROBE_DEFER
@ 2020-03-03 3:14 Anson Huang
2020-03-03 12:30 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Anson Huang @ 2020-03-03 3:14 UTC (permalink / raw)
To: lgirdwood, broonie, linux-kernel; +Cc: Linux-imx
devm_regulator_register() could return -EPROBE_DEFER when trying to
get init data and NOT all resources are available at that time, for
this case, error message should NOT be present, the driver will call
probe again later, so drop error message for -EPROBE_DEFER.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
drivers/regulator/anatop-regulator.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 754739d..41470a8 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -305,9 +305,10 @@ static int anatop_regulator_probe(struct platform_device *pdev)
/* register regulator */
rdev = devm_regulator_register(dev, rdesc, &config);
if (IS_ERR(rdev)) {
- dev_err(dev, "failed to register %s\n",
- rdesc->name);
- return PTR_ERR(rdev);
+ ret = PTR_ERR(rdev);
+ if (ret != -EPROBE_DEFER)
+ dev_err(dev, "failed to register %s\n", rdesc->name);
+ return ret;
}
platform_set_drvdata(pdev, rdev);
--
2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: anatop: Drop error message for -EPROBE_DEFER
2020-03-03 3:14 [PATCH] regulator: anatop: Drop error message for -EPROBE_DEFER Anson Huang
@ 2020-03-03 12:30 ` Mark Brown
2020-03-03 13:23 ` Anson Huang
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2020-03-03 12:30 UTC (permalink / raw)
To: Anson Huang; +Cc: lgirdwood, linux-kernel, Linux-imx
[-- Attachment #1: Type: text/plain, Size: 537 bytes --]
On Tue, Mar 03, 2020 at 11:14:21AM +0800, Anson Huang wrote:
> devm_regulator_register() could return -EPROBE_DEFER when trying to
> get init data and NOT all resources are available at that time, for
> this case, error message should NOT be present, the driver will call
> probe again later, so drop error message for -EPROBE_DEFER.
No, this is not good - it means that if there is some problem the user
will not get any information about why the driver is not instantiating
and how to fix it. At most lower the message to dev_dbg().
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] regulator: anatop: Drop error message for -EPROBE_DEFER
2020-03-03 12:30 ` Mark Brown
@ 2020-03-03 13:23 ` Anson Huang
2020-03-03 13:33 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Anson Huang @ 2020-03-03 13:23 UTC (permalink / raw)
To: Mark Brown; +Cc: lgirdwood, linux-kernel, dl-linux-imx
Hi, Mark
> Subject: Re: [PATCH] regulator: anatop: Drop error message for -
> EPROBE_DEFER
>
> On Tue, Mar 03, 2020 at 11:14:21AM +0800, Anson Huang wrote:
> > devm_regulator_register() could return -EPROBE_DEFER when trying to
> > get init data and NOT all resources are available at that time, for
> > this case, error message should NOT be present, the driver will call
> > probe again later, so drop error message for -EPROBE_DEFER.
>
> No, this is not good - it means that if there is some problem the user will not
> get any information about why the driver is not instantiating and how to fix it.
> At most lower the message to dev_dbg().
Make sense, will lower the message to debug level for -EPROBE_DEFER, it is just
because that user ever complained about the error message in normal level for
defer probe scenario, that is why I do this patch.
Thanks,
Anson
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] regulator: anatop: Drop error message for -EPROBE_DEFER
2020-03-03 13:23 ` Anson Huang
@ 2020-03-03 13:33 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2020-03-03 13:33 UTC (permalink / raw)
To: Anson Huang; +Cc: lgirdwood, linux-kernel, dl-linux-imx
[-- Attachment #1: Type: text/plain, Size: 318 bytes --]
On Tue, Mar 03, 2020 at 01:23:19PM +0000, Anson Huang wrote:
> Make sense, will lower the message to debug level for -EPROBE_DEFER, it is just
> because that user ever complained about the error message in normal level for
> defer probe scenario, that is why I do this patch.
Yes, lowering the severity makes sense.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-03 13:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 3:14 [PATCH] regulator: anatop: Drop error message for -EPROBE_DEFER Anson Huang
2020-03-03 12:30 ` Mark Brown
2020-03-03 13:23 ` Anson Huang
2020-03-03 13:33 ` 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®