Commit c8e977ba authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: use phy_check_link_status in more places in the state machine

Use phy_check_link_status in more places in the state machine.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 85a1f31d
...@@ -945,17 +945,13 @@ void phy_state_machine(struct work_struct *work) ...@@ -945,17 +945,13 @@ void phy_state_machine(struct work_struct *work)
break; break;
case PHY_NOLINK: case PHY_NOLINK:
case PHY_RUNNING:
if (!phy_polling_mode(phydev)) if (!phy_polling_mode(phydev))
break; break;
/* fall through */
err = phy_read_status(phydev); case PHY_CHANGELINK:
if (err) case PHY_RESUMING:
break; err = phy_check_link_status(phydev);
if (phydev->link) {
phydev->state = PHY_RUNNING;
phy_link_up(phydev);
}
break; break;
case PHY_FORCING: case PHY_FORCING:
err = genphy_update_link(phydev); err = genphy_update_link(phydev);
...@@ -971,32 +967,6 @@ void phy_state_machine(struct work_struct *work) ...@@ -971,32 +967,6 @@ void phy_state_machine(struct work_struct *work)
phy_link_down(phydev, false); phy_link_down(phydev, false);
} }
break; break;
case PHY_RUNNING:
if (!phy_polling_mode(phydev))
break;
err = phy_read_status(phydev);
if (err)
break;
if (!phydev->link) {
phydev->state = PHY_NOLINK;
phy_link_down(phydev, true);
}
break;
case PHY_CHANGELINK:
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, true);
}
break;
case PHY_HALTED: case PHY_HALTED:
if (phydev->link) { if (phydev->link) {
phydev->link = 0; phydev->link = 0;
...@@ -1004,19 +974,6 @@ void phy_state_machine(struct work_struct *work) ...@@ -1004,19 +974,6 @@ void phy_state_machine(struct work_struct *work)
do_suspend = true; do_suspend = true;
} }
break; break;
case PHY_RESUMING:
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, true);
}
break;
} }
mutex_unlock(&phydev->lock); mutex_unlock(&phydev->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment