[PATCH u-boot v2019.04-aspeed-openbmc 2/4] phy: Only create NCSI PHY when it's present

Joel Stanley joel at jms.id.au
Fri Jun 10 18:00:57 AEST 2022


phy_connect would unconditionally create a NCSI PHY device if the driver
was configured.

By detecting what the phy type is at runtime we can support NCSI and
non-NCSI system with the same defconfig,

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 drivers/net/phy/phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index a0f7b7964464..8e70746a1e76 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -932,7 +932,8 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
 #endif
 
 #ifdef CONFIG_PHY_NCSI
-	phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface);
+	if (interface == PHY_INTERFACE_MODE_NCSI)
+		phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface);
 #endif
 
 	if (!phydev)
-- 
2.35.1



More information about the openbmc mailing list