Message ID | f0248feb-f58a-b59e-a041-0421ec1f8151@gmail.com |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | net: phy: improve stopping PHY | expand |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index b5f5cda4c..9e588f03e 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);
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 <hkallweit1@gmail.com> --- drivers/net/phy/phy_device.c | 3 +++ 1 file changed, 3 insertions(+)