mirror of
https://github.com/torvalds/linux
synced 2024-10-15 15:59:15 +00:00
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: 5cb630925b
("net: renesas: rswitch: Add phy_power_{on,off}() calling")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
510b18cf23
commit
053f13f67b
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue