regulator: anatop: Drop error message for -EPROBE_DEFER
PATCH 1/1 regulator: anatop: Drop error message for -EPROBE_DEFER
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.
--- drivers/regulator/anatop-regulator.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/regulator/anatop-regulator.c +4 -3
@@ -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);
Signature · 1 line
2.7.4
Mark Brown
maintainerQuoted 4 lines · Anson Huang
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().
Hi, Mark
Quoted 4 lines
Subject: Re: [PATCH] regulator: anatop: Drop error message for -
EPROBE_DEFEROn Tue, Mar 03, 2020 at 11:14:21AM +0800, Anson Huang wrote:
Quoted 8 lines
Quoted 4 lines
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
Mark Brown
maintainerQuoted 3 lines · Anson Huang
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.