]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
phy: amlogic: phy-meson-gxl-usb2: don't log an error on -EPROBE_DEFER
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 28 Jan 2018 20:22:44 +0000 (21:22 +0100)
committerKishon Vijay Abraham I <kishon@ti.com>
Thu, 8 Mar 2018 08:26:26 +0000 (13:56 +0530)
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 - this second try works without any errors. So only
log actual errors to keep the kernel log free of misleading error
messages.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/amlogic/phy-meson-gxl-usb2.c

index e90c4ee25dfe5cde10912fb1c06a9ed642b1551e..d68c30d3b510866da5061171f4875852881c544b 100644 (file)
@@ -210,6 +210,7 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
        struct phy_meson_gxl_usb2_priv *priv;
        struct phy *phy;
        void __iomem *base;
+       int ret;
 
        priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
        if (!priv)
@@ -242,8 +243,11 @@ static int phy_meson_gxl_usb2_probe(struct platform_device *pdev)
 
        phy = devm_phy_create(dev, NULL, &phy_meson_gxl_usb2_ops);
        if (IS_ERR(phy)) {
-               dev_err(dev, "failed to create PHY\n");
-               return PTR_ERR(phy);
+               ret = PTR_ERR(phy);
+               if (ret != -EPROBE_DEFER)
+                       dev_err(dev, "failed to create PHY\n");
+
+               return ret;
        }
 
        phy_set_drvdata(phy, priv);