Skip to content

Commit 053f13f

Browse files
shimodayPaolo Abeni
authored andcommitted
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: 5cb6309 ("net: renesas: rswitch: Add phy_power_{on,off}() calling") Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 510b18c commit 053f13f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/renesas/rswitch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ static void rswitch_adjust_link(struct net_device *ndev)
12541254
phy_print_status(phydev);
12551255
if (phydev->link)
12561256
phy_power_on(rdev->serdes);
1257-
else
1257+
else if (rdev->serdes->power_count)
12581258
phy_power_off(rdev->serdes);
12591259

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

0 commit comments

Comments
 (0)