diff options
author | Heiner Kallweit | 2019-01-23 07:31:23 +0100 |
---|---|---|
committer | David S. Miller | 2019-01-24 22:15:15 -0800 |
commit | 9e573cfc35c6ffac45e385ed4f14f5187c09090a (patch) | |
tree | f7dc3439849756a7164f3111427f2826ddf4ea34 /drivers/net/phy/phy.c | |
parent | 217962615662f1ab7a60978a194444023039f0a4 (diff) |
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: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r-- | drivers/net/phy/phy.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index dedd57b86c80..079b6a617fc8 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -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); + /* if phy was suspended, bring the physical link up again */ + __phy_resume(phydev); - /* make sure interrupts are re-enabled for the PHY */ - if (phy_interrupt_is_valid(phydev)) { - err = phy_enable_interrupts(phydev); - if (err < 0) - break; - } + /* make sure interrupts are enabled for the PHY */ + if (phy_interrupt_is_valid(phydev)) { + err = phy_enable_interrupts(phydev); + if (err < 0) + goto out; + } + if (phydev->state == PHY_READY) + phydev->state = PHY_UP; + else phydev->state = PHY_RESUMING; - phy_start_machine(phydev); - break; - default: - break; - } + + phy_start_machine(phydev); out: mutex_unlock(&phydev->lock); } |