Skip to content

Commit 0cdaabc

Browse files
committed
net: phy: as21xx: Refactor the match_phy_device callback for AN8831X 10G PHY driver
Refactor the match_phy_device callback for AN8831X 10G PHY driver. Without this patch, the AN8831X driver will corrupt other phydev->phy_id variable, causing the GbE of the built-in Switch to fail in attaching the PHY driver on MT7988. based on: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/d09662ee85280bd00d58f5ca48e488bbf0c3cf7b%5E%21/#F2
1 parent 6a28525 commit 0cdaabc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/phy/as21xxx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,10 +1236,12 @@ static int as21xxx_config_led(struct phy_device *phydev)
12361236
static int as21xxx_match_phy_device(struct phy_device *phydev,
12371237
const struct phy_driver *phydrv)
12381238
{
1239+
u32 phy_id = aeon_read_pid(phydev);
12391240
/* AEONSEMI get pid. */
1240-
phydev->phy_id = aeon_read_pid(phydev);
12411241
if (phydev->phy_id != PHY_ID_AS21XXX)
12421242
return 0;
1243+
1244+
phydev->phy_id = phy_id;
12431245
aeon_mdio_write(phydev, 0x1E, 0x142, 0x48);
12441246
return 1;
12451247
}

0 commit comments

Comments
 (0)