summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Berger <opendmb@gmail.com>2017-03-09 16:58:46 -0800
committerDavid S. Miller <davem@davemloft.net>2017-03-09 18:39:01 -0800
commit7627409cc4970e8c8b9de6945ad86a575290a94e (patch)
tree93bbc395d16f65147b9b928cd058ee2387ebdab4
parenteca4bad73409aedc6ff22f823c18b67a4f08c851 (diff)
downloadop-kernel-dev-7627409cc4970e8c8b9de6945ad86a575290a94e.zip
op-kernel-dev-7627409cc4970e8c8b9de6945ad86a575290a94e.tar.gz
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: 1c1008c793fa ("net: bcmgenet: add main driver file") Signed-off-by: Doug Berger <opendmb@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 99f8d90..475dc14 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -2850,6 +2850,8 @@ err_irq0:
err_fini_dma:
bcmgenet_fini_dma(priv);
err_clk_disable:
+ if (priv->internal_phy)
+ bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
clk_disable_unprepare(priv->clk);
return ret;
}
@@ -3551,6 +3553,8 @@ static int bcmgenet_resume(struct device *d)
return 0;
out_clk_disable:
+ if (priv->internal_phy)
+ bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
clk_disable_unprepare(priv->clk);
return ret;
}
OpenPOWER on IntegriCloud