diff options
author | David S. Miller <[email protected]> | 2018-03-07 12:30:20 -0500 |
---|---|---|
committer | David S. Miller <[email protected]> | 2018-03-07 12:30:20 -0500 |
commit | b2b19494b80adc9d0e1e5631a69a24af47a5502c (patch) | |
tree | ac36f30727a5796381ecb8506bdf9adfb3540ece | |
parent | 4d1e46a55ea9f8d693ceabe1ba4b056e55fb6625 (diff) | |
parent | 70a55c32ee6f3781d294d64c75380c94f4b99ae8 (diff) |
Merge branch 'net-phy-remove-phy_error-from-phy_disable_interrupts'
Heiner Kallweit says:
====================
net: phy: remove phy_error from phy_disable_interrupts
All callers of phy_disable_interrupts() call phy_error() in the error
case. Therefore we don't need to do this within the function too.
This change also allows us to use phy_disable_interrupts() in code
holding phydev->lock (because phy_error() takes this lock).
Make use of this in phy_stop().
v2:
- splitted into two separate patches
====================
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | drivers/net/phy/phy.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index a6f924fee584..c2d9027be863 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -662,19 +662,10 @@ static int phy_disable_interrupts(struct phy_device *phydev) /* Disable PHY interrupts */ err = phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED); if (err) - goto phy_err; + return err; /* Clear the interrupt */ - err = phy_clear_interrupt(phydev); - if (err) - goto phy_err; - - return 0; - -phy_err: - phy_error(phydev); - - return err; + return phy_clear_interrupt(phydev); } /** @@ -774,13 +765,8 @@ void phy_stop(struct phy_device *phydev) if (PHY_HALTED == phydev->state) goto out_unlock; - if (phy_interrupt_is_valid(phydev)) { - /* Disable PHY Interrupts */ - phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED); - - /* Clear any pending interrupts */ - phy_clear_interrupt(phydev); - } + if (phy_interrupt_is_valid(phydev)) + phy_disable_interrupts(phydev); phydev->state = PHY_HALTED; |