]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: amlogic: phy-meson-g12a-usb2: Simplify error handling with dev_err_probe()
authorAnand Moon <linux.amoon@gmail.com>
Thu, 10 Apr 2025 13:33:17 +0000 (19:03 +0530)
committerVinod Koul <vkoul@kernel.org>
Fri, 11 Apr 2025 11:37:15 +0000 (17:07 +0530)
Use dev_err_probe() for phy resources to indicate the deferral
reason when waiting for the resource to come up.

Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250410133332.294556-3-linux.amoon@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/amlogic/phy-meson-g12a-usb2.c

index 0e0b5c00b676f476cc38b5bc7f0d3e2f726c84ea..66bf0b7ef8ed384c33e354171fd32772162aa313 100644 (file)
@@ -339,13 +339,9 @@ static int phy_meson_g12a_usb2_probe(struct platform_device *pdev)
                return ret;
 
        phy = devm_phy_create(dev, NULL, &phy_meson_g12a_usb2_ops);
-       if (IS_ERR(phy)) {
-               ret = PTR_ERR(phy);
-               if (ret != -EPROBE_DEFER)
-                       dev_err(dev, "failed to create PHY\n");
-
-               return ret;
-       }
+       if (IS_ERR(phy))
+               return dev_err_probe(dev, PTR_ERR(phy),
+                                    "failed to create PHY\n");
 
        phy_set_bus_width(phy, 8);
        phy_set_drvdata(phy, priv);