diff options
author | Jacky Chou <jacky_chou@aspeedtech.com> | 2024-01-15 18:34:47 +0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-03-26 19:58:26 -0400 |
commit | f146c446e51184a33deb798e8169aaf654c044a6 (patch) | |
tree | 890a73363a9cf69b7a3c3db0c9d65567c642d8c0 /drivers/net/phy/phy.c | |
parent | f5dbfc82a90b2333bfee76906df883ba86a85f56 (diff) | |
download | u-boot-f146c446e51184a33deb798e8169aaf654c044a6.zip u-boot-f146c446e51184a33deb798e8169aaf654c044a6.tar.gz u-boot-f146c446e51184a33deb798e8169aaf654c044a6.tar.bz2 |
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.
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index f39ca94..9cec04a 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -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; |