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

net: phy: start interrupts in phy_start

Interrupts don't have to be enabled before calling phy_start().
Therefore let's enable them in phy_start(). In a subsequent step
we'll remove enabling interrupts from phy_connect_direct().
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 21796261
......@@ -852,7 +852,7 @@ EXPORT_SYMBOL(phy_stop);
*/
void phy_start(struct phy_device *phydev)
{
int err = 0;
int err;
mutex_lock(&phydev->lock);
......@@ -862,28 +862,22 @@ void phy_start(struct phy_device *phydev)
goto out;
}
switch (phydev->state) {
case PHY_READY:
phydev->state = PHY_UP;
phy_start_machine(phydev);
break;
case PHY_HALTED:
/* if phy was suspended, bring the physical link up again */
__phy_resume(phydev);
/* make sure interrupts are re-enabled for the PHY */
/* make sure interrupts are enabled for the PHY */
if (phy_interrupt_is_valid(phydev)) {
err = phy_enable_interrupts(phydev);
if (err < 0)
break;
goto out;
}
if (phydev->state == PHY_READY)
phydev->state = PHY_UP;
else
phydev->state = PHY_RESUMING;
phy_start_machine(phydev);
break;
default:
break;
}
out:
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