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

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
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment