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 <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Heiner Kallweit 2019-01-17 20:07:54 +01:00 committed by David S. Miller
parent 340a6f3d2d
commit 472115d983

View file

@ -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);