Commit 053f13f6 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Paolo Abeni
Browse files

rswitch: Fix imbalance phy_power_off() calling



The phy_power_off() should not be called if phy_power_on() failed.
So, add a condition .power_count before calls phy_power_off().

Fixes: 5cb63092 ("net: renesas: rswitch: Add phy_power_{on,off}() calling")
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 510b18cf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1254,7 +1254,7 @@ static void rswitch_adjust_link(struct net_device *ndev)
		phy_print_status(phydev);
		if (phydev->link)
			phy_power_on(rdev->serdes);
		else
		else if (rdev->serdes->power_count)
			phy_power_off(rdev->serdes);

		rdev->etha->link = phydev->link;