net: phy: remove useless check in state machine case PHY_NOLINK
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 7 Nov 2018 19:43:20 +0000 (20:43 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Nov 2018 23:02:05 +0000 (15:02 -0800)
If aneg is enabled and the PHY reports the link as up then definitely
aneg finished successfully. Therefore this check is useless and
can be removed.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy.c

index 476578746d9192d9b47117bda50f13263346e0dc..87c6d304cbc866d17d063da6300398408d205c0d 100644 (file)
@@ -970,17 +970,6 @@ void phy_state_machine(struct work_struct *work)
                        break;
 
                if (phydev->link) {
-                       if (AUTONEG_ENABLE == phydev->autoneg) {
-                               err = phy_aneg_done(phydev);
-                               if (err < 0)
-                                       break;
-
-                               if (!err) {
-                                       phydev->state = PHY_AN;
-                                       phydev->link_timeout = PHY_AN_TIMEOUT;
-                                       break;
-                               }
-                       }
                        phydev->state = PHY_RUNNING;
                        phy_link_up(phydev);
                }