net: phy: don't double-read link status register if link is up
The link status register latches link-down events. Therefore, if link is reported as being up, there's no need for a second read. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
9a00536c38
commit
c397ab21ba
@@ -148,6 +148,8 @@ int genphy_c45_read_link(struct phy_device *phydev)
|
||||
val = phy_read_mmd(phydev, devad, MDIO_STAT1);
|
||||
if (val < 0)
|
||||
return val;
|
||||
else if (val & MDIO_STAT1_LSTATUS)
|
||||
continue;
|
||||
}
|
||||
|
||||
val = phy_read_mmd(phydev, devad, MDIO_STAT1);
|
||||
|
Reference in New Issue
Block a user