summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-01-18 14:12:25 -0800
committerDavid S. Miller <davem@davemloft.net>2019-01-18 14:12:25 -0800
commit209f94e6185465a18328f07dc332ea7cee0b72fc (patch)
tree36132c101bee7156226713c6038de55babc073ea /drivers/net/phy/phy_device.c
parent340a6f3d2d52a1b72f3454818e53293807f8f127 (diff)
parentbb658ab7b8f2828b35c207a95cb0c05965721022 (diff)
Merge branch 'phy-improve-stopping-PHY'
Heiner Kallweit says: ==================== net: phy: improve stopping PHY This patchset improves and simplifies stopping the PHY. Heiner Kallweit (3): net: phy: stop PHY if needed when entering phy_disconnect net: phy: ensure phylib state machine is stopped after calling phy_stop net: phy: remove phy_stop_interrupts v2: - break down the patch to a patchset v3: - don't warn if driver didn't call phy_stop before phy_disconnect ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 3860dd85d097..7b3164174251 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -999,10 +999,11 @@ EXPORT_SYMBOL(phy_connect);
*/
void phy_disconnect(struct phy_device *phydev)
{
- if (phydev->irq > 0)
- phy_stop_interrupts(phydev);
+ if (phy_is_started(phydev))
+ phy_stop(phydev);
- phy_stop_machine(phydev);
+ if (phy_interrupt_is_valid(phydev))
+ free_irq(phydev->irq, phydev);
phydev->adjust_link = NULL;