From 472115d9834cd3a194a14269f28d8b146ad26c11 Mon Sep 17 00:00:00 2001 From: Heiner Kallweit Date: Thu, 17 Jan 2019 20:07:54 +0100 Subject: [PATCH] net: phy: stop PHY if needed when entering phy_disconnect Stop PHY if needed when entering phy_disconnect. This allows drivers that don't need a separate call to phy_stop() to omit this call. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller --- drivers/net/phy/phy_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 3860dd85d097..616a5fe47f56 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -999,6 +999,9 @@ EXPORT_SYMBOL(phy_connect); */ void phy_disconnect(struct phy_device *phydev) { + if (phy_is_started(phydev)) + phy_stop(phydev); + if (phydev->irq > 0) phy_stop_interrupts(phydev); -- 2.30.2