Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb4c470a authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller
Browse files

net: phy: simplify handling of PHY_RESUMING in state machine



Simplify code for handling state PHY_RESUMING, no functional change
intended.

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 74fb5e25
Loading
Loading
Loading
Loading
+14 −29
Original line number Diff line number Diff line
@@ -1059,29 +1059,15 @@ void phy_state_machine(struct work_struct *work)
	case PHY_RESUMING:
		if (AUTONEG_ENABLE == phydev->autoneg) {
			err = phy_aneg_done(phydev);
			if (err < 0)
			if (err < 0) {
				break;

			/* err > 0 if AN is done.
			 * Otherwise, it's 0, and we're  still waiting for AN
			 */
			if (err > 0) {
				err = phy_read_status(phydev);
				if (err)
					break;

				if (phydev->link) {
					phydev->state = PHY_RUNNING;
					phy_link_up(phydev);
				} else	{
					phydev->state = PHY_NOLINK;
					phy_link_down(phydev, false);
				}
			} else {
			} else if (!err) {
				phydev->state = PHY_AN;
				phydev->link_timeout = PHY_AN_TIMEOUT;
				break;
			}
		} else {
		}

		err = phy_read_status(phydev);
		if (err)
			break;
@@ -1093,7 +1079,6 @@ void phy_state_machine(struct work_struct *work)
			phydev->state = PHY_NOLINK;
			phy_link_down(phydev, false);
		}
		}
		break;
	}