diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2019-02-07 22:22:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-09 10:01:49 +0300 |
commit | c397ab21ba362d5c5215e53f36685a9fffc45f66 (patch) | |
tree | 7a96407c8fcaff6869aa3e42c4b892c5f31381f3 /drivers/net/phy/phy-c45.c | |
parent | 9a00536c38e9df8b6d942316888990d849fe1d01 (diff) | |
download | linux-c397ab21ba362d5c5215e53f36685a9fffc45f66.tar.xz |
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>
Diffstat (limited to 'drivers/net/phy/phy-c45.c')
-rw-r--r-- | drivers/net/phy/phy-c45.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c index 706a92a8c1b2..eff9e5a4d831 100644 --- a/drivers/net/phy/phy-c45.c +++ b/drivers/net/phy/phy-c45.c @@ -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); |