aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/fec.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index aa1db8e637cd..8026a16f6b6c 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1492,16 +1492,14 @@ static int
1492fec_suspend(struct device *dev) 1492fec_suspend(struct device *dev)
1493{ 1493{
1494 struct net_device *ndev = dev_get_drvdata(dev); 1494 struct net_device *ndev = dev_get_drvdata(dev);
1495 struct fec_enet_private *fep; 1495 struct fec_enet_private *fep = netdev_priv(ndev);
1496 1496
1497 if (ndev) { 1497 if (netif_running(ndev)) {
1498 fep = netdev_priv(ndev); 1498 fec_stop(ndev);
1499 if (netif_running(ndev)) { 1499 netif_device_detach(ndev);
1500 fec_stop(ndev);
1501 netif_device_detach(ndev);
1502 }
1503 clk_disable(fep->clk);
1504 } 1500 }
1501 clk_disable(fep->clk);
1502
1505 return 0; 1503 return 0;
1506} 1504}
1507 1505
@@ -1509,16 +1507,14 @@ static int
1509fec_resume(struct device *dev) 1507fec_resume(struct device *dev)
1510{ 1508{
1511 struct net_device *ndev = dev_get_drvdata(dev); 1509 struct net_device *ndev = dev_get_drvdata(dev);
1512 struct fec_enet_private *fep; 1510 struct fec_enet_private *fep = netdev_priv(ndev);
1513 1511
1514 if (ndev) { 1512 clk_enable(fep->clk);
1515 fep = netdev_priv(ndev); 1513 if (netif_running(ndev)) {
1516 clk_enable(fep->clk); 1514 fec_restart(ndev, fep->full_duplex);
1517 if (netif_running(ndev)) { 1515 netif_device_attach(ndev);
1518 fec_restart(ndev, fep->full_duplex);
1519 netif_device_attach(ndev);
1520 }
1521 } 1516 }
1517
1522 return 0; 1518 return 0;
1523} 1519}
1524 1520