From: Heiner Kallweit Date: Thu, 17 Jan 2019 19:07:54 +0000 (+0100) Subject: net: phy: stop PHY if needed when entering phy_disconnect X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=472115d9834cd3a194a14269f28d8b146ad26c11;p=linux.git 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 --- diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 3860dd85d0976..616a5fe47f569 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);