[PATCH u-boot-net v4 13/14] bcmgenet, sun8i_emac: Don't connect PHY two times

Marek Behún kabel at kernel.org
Thu Apr 7 00:33:07 CEST 2022


From: Marek Behún <marek.behun at nic.cz>

The bcmgenet and sun8i_emac drivers call phy_connect(), which finds /
creates the PHY and also connects it to the eth device via
phy_connect_dev(), then set some phydev members (bcmgenet only), and
then call phy_connect_dev() explicitly again.

Drop the second phy_connect_dev(), since it is unnecesary.

Signed-off-by: Marek Behún <marek.behun at nic.cz>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>
---
 drivers/net/bcmgenet.c   | 2 --
 drivers/net/sun8i_emac.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
index ef321f2839..4e1f8ed7a4 100644
--- a/drivers/net/bcmgenet.c
+++ b/drivers/net/bcmgenet.c
@@ -526,8 +526,6 @@ static int bcmgenet_phy_init(struct bcmgenet_eth_priv *priv, void *dev)
 	}
 	phydev->advertising = phydev->supported;
 
-	phy_connect_dev(phydev, dev);
-
 	priv->phydev = phydev;
 	phy_config(priv->phydev);
 
diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 5943a5e3f0..906a8ec5d0 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -391,8 +391,6 @@ static int sun8i_phy_init(struct emac_eth_dev *priv, void *dev)
 	if (!phydev)
 		return -ENODEV;
 
-	phy_connect_dev(phydev, dev);
-
 	priv->phydev = phydev;
 	phy_config(priv->phydev);
 
-- 
2.35.1



More information about the U-Boot mailing list