mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 14:23:49 +01:00
net: phy: prevent PHYs w/o Clause 22 regs from calling genphy_config_aneg
genphy_config_aneg() should be called only by PHYs that implement the Clause 22 register set. Prevent Clause 45 PHYs that don't implement the register set from calling the genphy function. Signed-off-by: Camelia Groza <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
7e50b2a51d
commit
34786005ec
1 file changed
+8
-2
@@ -471,8 +471,14 @@ static int phy_config_aneg(struct phy_device *phydev)
|
||||
{
|
||||
if (phydev->drv->config_aneg)
|
||||
return phydev->drv->config_aneg(phydev);
|
||||
else
|
||||
return genphy_config_aneg(phydev);
|
||||
|
||||
/* Clause 45 PHYs that don't implement Clause 22 registers are not
|
||||
* allowed to call genphy_config_aneg()
|
||||
*/
|
||||
if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0)))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
return genphy_config_aneg(phydev);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user