summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnand Moon <linux.amoon@gmail.com>2025-04-10 19:03:21 +0530
committerVinod Koul <vkoul@kernel.org>2025-04-11 17:07:15 +0530
commitbdeff6d8a211c832f5ce1a65aff17f4a5e6de00f (patch)
tree556e2e88230559774270c22c21c9817378235020
parentfef364bd4c9cf712c91e0013f5f304f4e7f09198 (diff)
phy: amlogic: phy-meson-axg-pcie: Fix PHY creation order in axg-pcie probe
Reorder the PHY creation in the axg-pcie probe function to ensure all the resource is mapped before creating the PHY. This change addresses the issue where the PHY creation was attempted before mapping the necessary resources, potentially causing failures. 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-7-linux.amoon@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/phy/amlogic/phy-meson-axg-pcie.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/phy/amlogic/phy-meson-axg-pcie.c b/drivers/phy/amlogic/phy-meson-axg-pcie.c
index 54baf7b8930e..14dee73f9cb5 100644
--- a/drivers/phy/amlogic/phy-meson-axg-pcie.c
+++ b/drivers/phy/amlogic/phy-meson-axg-pcie.c
@@ -136,11 +136,6 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
if (!priv)
return -ENOMEM;
- priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
- if (IS_ERR(priv->phy))
- return dev_err_probe(dev, PTR_ERR(priv->phy),
- "failed to create PHY\n");
-
base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(base))
return PTR_ERR(base);
@@ -158,6 +153,11 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
if (IS_ERR(priv->analog))
return PTR_ERR(priv->analog);
+ priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
+ if (IS_ERR(priv->phy))
+ return dev_err_probe(dev, PTR_ERR(priv->phy),
+ "failed to create PHY\n");
+
phy_set_drvdata(priv->phy, priv);
dev_set_drvdata(dev, priv);
pphy = devm_of_phy_provider_register(dev, of_phy_simple_xlate);