Skip to content

Commit

Permalink
net: phy: stop PHY if needed when entering phy_disconnect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Jan 18, 2019
1 parent 340a6f3 commit 472115d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 472115d

Please sign in to comment.