Change the order to connect gmiitorgmii before PHY creation.
The gmiitorgmii create additional in DTS configured PHY during
it's configuration. This ensures, that converter sits between the
MAC and the external phy
MAC <==> GMII2RGMII <==> RGMII_PHY.

Fixes: commit a744a284e354 ("net: phy: Add support for ethernet-phy-id with 
gpio reset")
Signed-off-by: Tapio Reijonen <[email protected]>
---

 drivers/net/phy/phy.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 716a1d46111..740533adeca 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -939,14 +939,14 @@ struct phy_device *phy_connect(struct mii_dev *bus, int 
addr,
                phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false);
 #endif
 
-#ifdef CONFIG_PHY_ETHERNET_ID
+#ifdef CONFIG_PHY_XILINX_GMII2RGMII
        if (!phydev)
-               phydev = phy_connect_phy_id(bus, dev, addr);
+               phydev = phy_connect_gmii2rgmii(bus, dev);
 #endif
 
-#ifdef CONFIG_PHY_XILINX_GMII2RGMII
+#ifdef CONFIG_PHY_ETHERNET_ID
        if (!phydev)
-               phydev = phy_connect_gmii2rgmii(bus, dev);
+               phydev = phy_connect_phy_id(bus, dev, addr);
 #endif
 
        if (!phydev)
-- 
2.39.5

Reply via email to