Skip to content

Commit 4af7689

Browse files
committed
net: phy: as21: fix phy-id overwrite for all phys (breaking leds on mt7988 internal 1G phy)
1 parent 2cb620b commit 4af7689

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/phy/as21xxx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,10 +1236,11 @@ 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);
1241-
if (phydev->phy_id != PHY_ID_AS21XXX)
1241+
if (phy_id != PHY_ID_AS21XXX)
12421242
return 0;
1243+
phydev->phy_id = phy_id;
12431244
aeon_mdio_write(phydev, 0x1E, 0x142, 0x48);
12441245
return 1;
12451246
}

0 commit comments

Comments
 (0)