Commit 7627409c authored by Doug Berger's avatar Doug Berger Committed by David S. Miller

net: bcmgenet: power down internal phy if open or resume fails

Since the internal PHY is powered up during the open and resume
functions it should be powered back down if the functions fail.

Fixes: 1c1008c7 ("net: bcmgenet: add main driver file")
Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eca4bad7
...@@ -2850,6 +2850,8 @@ static int bcmgenet_open(struct net_device *dev) ...@@ -2850,6 +2850,8 @@ static int bcmgenet_open(struct net_device *dev)
err_fini_dma: err_fini_dma:
bcmgenet_fini_dma(priv); bcmgenet_fini_dma(priv);
err_clk_disable: err_clk_disable:
if (priv->internal_phy)
bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
clk_disable_unprepare(priv->clk); clk_disable_unprepare(priv->clk);
return ret; return ret;
} }
...@@ -3551,6 +3553,8 @@ static int bcmgenet_resume(struct device *d) ...@@ -3551,6 +3553,8 @@ static int bcmgenet_resume(struct device *d)
return 0; return 0;
out_clk_disable: out_clk_disable:
if (priv->internal_phy)
bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
clk_disable_unprepare(priv->clk); clk_disable_unprepare(priv->clk);
return ret; return ret;
} }
......
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