2021-06-17 21:29:31

by Anand Moon

[permalink] [raw]
Subject: [RFCv1 8/8] phy: amlogic: meson8b-usb2: don't log an error on -EPROBE_DEFER

devm_phy_create can return -EPROBE_DEFER if the phy-supply is not ready
yet. Silence this warning as the driver framework will re-attempt
registering the PHY. Use dev_err_probe() for phy resources to indicate
the deferral reason when waiting for the resource to come up.

Cc: Martin Blumenstingl <[email protected]>
Signed-off-by: Anand Moon <[email protected]>
---
drivers/phy/amlogic/phy-meson8b-usb2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/amlogic/phy-meson8b-usb2.c b/drivers/phy/amlogic/phy-meson8b-usb2.c
index d5edd31686bb..bd624781d914 100644
--- a/drivers/phy/amlogic/phy-meson8b-usb2.c
+++ b/drivers/phy/amlogic/phy-meson8b-usb2.c
@@ -332,8 +332,8 @@ static int phy_meson8b_usb2_probe(struct platform_device *pdev)

phy = devm_phy_create(&pdev->dev, NULL, &phy_meson8b_usb2_ops);
if (IS_ERR(phy)) {
- dev_err(&pdev->dev, "failed to create PHY\n");
- return PTR_ERR(phy);
+ ret = PTR_ERR(phy);
+ return dev_err_probe(&pdev->dev, ret, "failed to create PHY\n");
}

phy_set_drvdata(phy, priv);
--
2.31.1


2021-06-18 02:45:31

by Martin Blumenstingl

[permalink] [raw]
Subject: Re: [RFCv1 8/8] phy: amlogic: meson8b-usb2: don't log an error on -EPROBE_DEFER

On Thu, Jun 17, 2021 at 9:44 PM Anand Moon <[email protected]> wrote:
>
> devm_phy_create can return -EPROBE_DEFER if the phy-supply is not ready
> yet. Silence this warning as the driver framework will re-attempt
> registering the PHY. Use dev_err_probe() for phy resources to indicate
> the deferral reason when waiting for the resource to come up.
This is a good improvement - thank you!

> Cc: Martin Blumenstingl <[email protected]>
> Signed-off-by: Anand Moon <[email protected]>
Reviewed-by: Martin Blumenstingl <[email protected]>