Skip to content

Commit bdeff6d

Browse files
moonlinuxvinodkoul
authored andcommitted
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 <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent fef364b commit bdeff6d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/phy/amlogic/phy-meson-axg-pcie.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
136136
if (!priv)
137137
return -ENOMEM;
138138

139-
priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
140-
if (IS_ERR(priv->phy))
141-
return dev_err_probe(dev, PTR_ERR(priv->phy),
142-
"failed to create PHY\n");
143-
144139
base = devm_platform_ioremap_resource(pdev, 0);
145140
if (IS_ERR(base))
146141
return PTR_ERR(base);
@@ -158,6 +153,11 @@ static int phy_axg_pcie_probe(struct platform_device *pdev)
158153
if (IS_ERR(priv->analog))
159154
return PTR_ERR(priv->analog);
160155

156+
priv->phy = devm_phy_create(dev, np, &phy_axg_pcie_ops);
157+
if (IS_ERR(priv->phy))
158+
return dev_err_probe(dev, PTR_ERR(priv->phy),
159+
"failed to create PHY\n");
160+
161161
phy_set_drvdata(priv->phy, priv);
162162
dev_set_drvdata(dev, priv);
163163
pphy = devm_of_phy_provider_register(dev, of_phy_simple_xlate);

0 commit comments

Comments
 (0)