Skip to contentSkip to conversation

net: phy: the NC-SI phy device do not require mdio bus

PATCH In review Jacky Chou 3 participants 3 messages Jan 15, 2024 – Mar 28, 2024

Subsystems (2)
lore
Share & tools
lore

Jacky Chou

author
#0 lore raw

PATCH 1/1 net: phy: the NC-SI phy device do not require mdio bus

As with fixed-link phy device, the NC-SI phy devive does not require an mdio bus. So, a condition is added to check the NC-SI phy id to avoid accessing the bus pointer that is NULL.

---
 drivers/net/phy/phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/phy.c +2 -1
index 63b3e46f10..9991d86037 100644
@@ -566,7 +566,8 @@ struct phy_device *phy_device_create(struct mii_dev *bus, int addr,
 		return NULL;
 	}
 
-	if (addr >= 0 && addr < PHY_MAX_ADDR && phy_id != PHY_FIXED_ID)
+	if (addr >= 0 && addr < PHY_MAX_ADDR && phy_id != PHY_FIXED_ID &&
+	    phy_id != PHY_NCSI_ID)
 		bus->phymap[addr] = dev;
 
 	return dev;
Signature · 1 line
2.34.1
#2 lore raw
In reply to Jacky Chou
Quoted 5 lines · Jacky Chou

As with fixed-link phy device, the NC-SI phy devive does not require an mdio bus. So, a condition is added to check the NC-SI phy id to avoid accessing the bus pointer that is NULL.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom