Aeonsemi driver 1.9.2 unconditionally overwrite phydev->phy_id in aeon_gen2_match_phy_device() and this prevent usage SFP modules with internal phy.
diff --git a/drivers/net/phy/as21xx_1.9.2/as21xxx.c b/drivers/net/phy/as21xx_1.9.2/as21xxx.c
index 2b2a96f1cddc..e1c27210a89b 100644
--- a/drivers/net/phy/as21xx_1.9.2/as21xxx.c
+++ b/drivers/net/phy/as21xx_1.9.2/as21xxx.c
@@ -1494,12 +1494,13 @@ static int aeon_gen2_match_phy_device(struct phy_device *phydev,
const struct phy_driver *phydrv)
{
/* AEONSEMI get pid. */
- phydev->phy_id = aeon_gen2_read_pid(phydev);
+ u32 phy_id = aeon_gen2_read_pid(phydev);
- if (phydev->phy_id == PHY_ID_AS22XXX)
- return 1;
+ if (phy_id != PHY_ID_AS22XXX)
+ return 0;
- return 0;
+ phydev->phy_id = phy_id;
+ return 1;
}
static void aeon_gen1_remove(struct phy_device *phydev)
Aeonsemi driver 1.9.2 unconditionally overwrite phydev->phy_id in aeon_gen2_match_phy_device() and this prevent usage SFP modules with internal phy.