aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-05-27 15:01:12 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-28 01:34:51 -0400
commitdfd93c977d84fef77404b689ef95bc716b313533 (patch)
treeab1084c9933e81cd603f5b01d3f50b53dc2d2f5d
parent3acfeac351c6ab2fe1139ee13d780729af0c8145 (diff)
net: ethernet: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Roland Stigge <stigge@antcom.de> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Tested-by: Roland Stigge <stigge@antcom.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/8390/ne.c1
-rw-r--r--drivers/net/ethernet/adi/bfin_mac.c4
-rw-r--r--drivers/net/ethernet/amd/au1000_eth.c2
-rw-r--r--drivers/net/ethernet/broadcom/bcm63xx_enet.c1
-rw-r--r--drivers/net/ethernet/cadence/at91_ether.c1
-rw-r--r--drivers/net/ethernet/cadence/macb.c2
-rw-r--r--drivers/net/ethernet/calxeda/xgmac.c2
-rw-r--r--drivers/net/ethernet/cirrus/ep93xx_eth.c1
-rw-r--r--drivers/net/ethernet/davicom/dm9000.c2
-rw-r--r--drivers/net/ethernet/ethoc.c2
-rw-r--r--drivers/net/ethernet/faraday/ftgmac100.c2
-rw-r--r--drivers/net/ethernet/faraday/ftmac100.c2
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c2
-rw-r--r--drivers/net/ethernet/korina.c1
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c2
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c2
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c1
-rw-r--r--drivers/net/ethernet/micrel/ks8695net.c1
-rw-r--r--drivers/net/ethernet/micrel/ks8842.c1
-rw-r--r--drivers/net/ethernet/micrel/ks8851_mll.c1
-rw-r--r--drivers/net/ethernet/netx-eth.c1
-rw-r--r--drivers/net/ethernet/nuvoton/w90p910_ether.c2
-rw-r--r--drivers/net/ethernet/nxp/lpc_eth.c2
-rw-r--r--drivers/net/ethernet/renesas/sh_eth.c1
-rw-r--r--drivers/net/ethernet/s6gmac.c1
-rw-r--r--drivers/net/ethernet/seeq/sgiseeq.c1
-rw-r--r--drivers/net/ethernet/sgi/meth.c1
-rw-r--r--drivers/net/ethernet/smsc/smc911x.c2
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c3
-rw-r--r--drivers/net/ethernet/smsc/smsc911x.c2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c2
-rw-r--r--drivers/net/ethernet/ti/cpsw.c1
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c2
-rw-r--r--drivers/net/ethernet/tundra/tsi108_eth.c1
-rw-r--r--drivers/net/ethernet/wiznet/w5100.c2
-rw-r--r--drivers/net/ethernet/wiznet/w5300.c2
-rw-r--r--drivers/net/ethernet/xscale/ixp4xx_eth.c2
37 files changed, 0 insertions, 61 deletions
diff --git a/drivers/net/ethernet/8390/ne.c b/drivers/net/ethernet/8390/ne.c
index 47618e505355..b2e840513735 100644
--- a/drivers/net/ethernet/8390/ne.c
+++ b/drivers/net/ethernet/8390/ne.c
@@ -849,7 +849,6 @@ static int ne_drv_remove(struct platform_device *pdev)
849 free_irq(dev->irq, dev); 849 free_irq(dev->irq, dev);
850 release_region(dev->base_addr, NE_IO_EXTENT); 850 release_region(dev->base_addr, NE_IO_EXTENT);
851 free_netdev(dev); 851 free_netdev(dev);
852 platform_set_drvdata(pdev, NULL);
853 } 852 }
854 return 0; 853 return 0;
855} 854}
diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index dada66bfe0d6..e904b3838dcc 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -1719,7 +1719,6 @@ out_err_mii_probe:
1719 mdiobus_unregister(lp->mii_bus); 1719 mdiobus_unregister(lp->mii_bus);
1720 mdiobus_free(lp->mii_bus); 1720 mdiobus_free(lp->mii_bus);
1721out_err_probe_mac: 1721out_err_probe_mac:
1722 platform_set_drvdata(pdev, NULL);
1723 free_netdev(ndev); 1722 free_netdev(ndev);
1724 1723
1725 return rc; 1724 return rc;
@@ -1732,8 +1731,6 @@ static int bfin_mac_remove(struct platform_device *pdev)
1732 1731
1733 bfin_phc_release(lp); 1732 bfin_phc_release(lp);
1734 1733
1735 platform_set_drvdata(pdev, NULL);
1736
1737 lp->mii_bus->priv = NULL; 1734 lp->mii_bus->priv = NULL;
1738 1735
1739 unregister_netdev(ndev); 1736 unregister_netdev(ndev);
@@ -1868,7 +1865,6 @@ static int bfin_mii_bus_remove(struct platform_device *pdev)
1868 struct bfin_mii_bus_platform_data *mii_bus_pd = 1865 struct bfin_mii_bus_platform_data *mii_bus_pd =
1869 dev_get_platdata(&pdev->dev); 1866 dev_get_platdata(&pdev->dev);
1870 1867
1871 platform_set_drvdata(pdev, NULL);
1872 mdiobus_unregister(miibus); 1868 mdiobus_unregister(miibus);
1873 kfree(miibus->irq); 1869 kfree(miibus->irq);
1874 mdiobus_free(miibus); 1870 mdiobus_free(miibus);
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 688aede742c7..ceb45bc963a9 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -1301,8 +1301,6 @@ static int au1000_remove(struct platform_device *pdev)
1301 int i; 1301 int i;
1302 struct resource *base, *macen; 1302 struct resource *base, *macen;
1303 1303
1304 platform_set_drvdata(pdev, NULL);
1305
1306 unregister_netdev(dev); 1304 unregister_netdev(dev);
1307 mdiobus_unregister(aup->mii_bus); 1305 mdiobus_unregister(aup->mii_bus);
1308 mdiobus_free(aup->mii_bus); 1306 mdiobus_free(aup->mii_bus);
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 0b3e23ec37f7..e46466cb3627 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1847,7 +1847,6 @@ static int bcm_enet_remove(struct platform_device *pdev)
1847 clk_disable_unprepare(priv->mac_clk); 1847 clk_disable_unprepare(priv->mac_clk);
1848 clk_put(priv->mac_clk); 1848 clk_put(priv->mac_clk);
1849 1849
1850 platform_set_drvdata(pdev, NULL);
1851 free_netdev(dev); 1850 free_netdev(dev);
1852 return 0; 1851 return 0;
1853} 1852}
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index cc9a185f0abb..3f1957158a3b 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -435,7 +435,6 @@ static int at91ether_remove(struct platform_device *pdev)
435 unregister_netdev(dev); 435 unregister_netdev(dev);
436 clk_disable(lp->pclk); 436 clk_disable(lp->pclk);
437 free_netdev(dev); 437 free_netdev(dev);
438 platform_set_drvdata(pdev, NULL);
439 438
440 return 0; 439 return 0;
441} 440}
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index c89aa41dd448..4465e27ba9d1 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1649,7 +1649,6 @@ err_out_put_pclk:
1649err_out_free_dev: 1649err_out_free_dev:
1650 free_netdev(dev); 1650 free_netdev(dev);
1651err_out: 1651err_out:
1652 platform_set_drvdata(pdev, NULL);
1653 return err; 1652 return err;
1654} 1653}
1655 1654
@@ -1675,7 +1674,6 @@ static int __exit macb_remove(struct platform_device *pdev)
1675 clk_disable_unprepare(bp->pclk); 1674 clk_disable_unprepare(bp->pclk);
1676 clk_put(bp->pclk); 1675 clk_put(bp->pclk);
1677 free_netdev(dev); 1676 free_netdev(dev);
1678 platform_set_drvdata(pdev, NULL);
1679 } 1677 }
1680 1678
1681 return 0; 1679 return 0;
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 4a1f2fa812ab..7cb148c495c9 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -1790,7 +1790,6 @@ err_io:
1790 free_netdev(ndev); 1790 free_netdev(ndev);
1791err_alloc: 1791err_alloc:
1792 release_mem_region(res->start, resource_size(res)); 1792 release_mem_region(res->start, resource_size(res));
1793 platform_set_drvdata(pdev, NULL);
1794 return ret; 1793 return ret;
1795} 1794}
1796 1795
@@ -1813,7 +1812,6 @@ static int xgmac_remove(struct platform_device *pdev)
1813 free_irq(ndev->irq, ndev); 1812 free_irq(ndev->irq, ndev);
1814 free_irq(priv->pmt_irq, ndev); 1813 free_irq(priv->pmt_irq, ndev);
1815 1814
1816 platform_set_drvdata(pdev, NULL);
1817 unregister_netdev(ndev); 1815 unregister_netdev(ndev);
1818 netif_napi_del(&priv->napi); 1816 netif_napi_del(&priv->napi);
1819 1817
diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c b/drivers/net/ethernet/cirrus/ep93xx_eth.c
index 67b0388b6e68..e3d4ec836f8b 100644
--- a/drivers/net/ethernet/cirrus/ep93xx_eth.c
+++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c
@@ -783,7 +783,6 @@ static int ep93xx_eth_remove(struct platform_device *pdev)
783 dev = platform_get_drvdata(pdev); 783 dev = platform_get_drvdata(pdev);
784 if (dev == NULL) 784 if (dev == NULL)
785 return 0; 785 return 0;
786 platform_set_drvdata(pdev, NULL);
787 786
788 ep = netdev_priv(dev); 787 ep = netdev_priv(dev);
789 788
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index dd243a1b03e0..a13b312b50f2 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1699,8 +1699,6 @@ dm9000_drv_remove(struct platform_device *pdev)
1699{ 1699{
1700 struct net_device *ndev = platform_get_drvdata(pdev); 1700 struct net_device *ndev = platform_get_drvdata(pdev);
1701 1701
1702 platform_set_drvdata(pdev, NULL);
1703
1704 unregister_netdev(ndev); 1702 unregister_netdev(ndev);
1705 dm9000_release_board(pdev, netdev_priv(ndev)); 1703 dm9000_release_board(pdev, netdev_priv(ndev));
1706 free_netdev(ndev); /* free device structure */ 1704 free_netdev(ndev); /* free device structure */
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 5722bc61fa58..cf579fb39bc5 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -1147,8 +1147,6 @@ static int ethoc_remove(struct platform_device *pdev)
1147 struct net_device *netdev = platform_get_drvdata(pdev); 1147 struct net_device *netdev = platform_get_drvdata(pdev);
1148 struct ethoc *priv = netdev_priv(netdev); 1148 struct ethoc *priv = netdev_priv(netdev);
1149 1149
1150 platform_set_drvdata(pdev, NULL);
1151
1152 if (netdev) { 1150 if (netdev) {
1153 netif_napi_del(&priv->napi); 1151 netif_napi_del(&priv->napi);
1154 phy_disconnect(priv->phy); 1152 phy_disconnect(priv->phy);
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 21b85fb7d05f..934e1ae279f0 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1311,7 +1311,6 @@ err_ioremap:
1311 release_resource(priv->res); 1311 release_resource(priv->res);
1312err_req_mem: 1312err_req_mem:
1313 netif_napi_del(&priv->napi); 1313 netif_napi_del(&priv->napi);
1314 platform_set_drvdata(pdev, NULL);
1315 free_netdev(netdev); 1314 free_netdev(netdev);
1316err_alloc_etherdev: 1315err_alloc_etherdev:
1317 return err; 1316 return err;
@@ -1335,7 +1334,6 @@ static int __exit ftgmac100_remove(struct platform_device *pdev)
1335 release_resource(priv->res); 1334 release_resource(priv->res);
1336 1335
1337 netif_napi_del(&priv->napi); 1336 netif_napi_del(&priv->napi);
1338 platform_set_drvdata(pdev, NULL);
1339 free_netdev(netdev); 1337 free_netdev(netdev);
1340 return 0; 1338 return 0;
1341} 1339}
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index a6eda8d83138..4658f4cc1969 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1149,7 +1149,6 @@ err_ioremap:
1149 release_resource(priv->res); 1149 release_resource(priv->res);
1150err_req_mem: 1150err_req_mem:
1151 netif_napi_del(&priv->napi); 1151 netif_napi_del(&priv->napi);
1152 platform_set_drvdata(pdev, NULL);
1153 free_netdev(netdev); 1152 free_netdev(netdev);
1154err_alloc_etherdev: 1153err_alloc_etherdev:
1155 return err; 1154 return err;
@@ -1169,7 +1168,6 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
1169 release_resource(priv->res); 1168 release_resource(priv->res);
1170 1169
1171 netif_napi_del(&priv->napi); 1170 netif_napi_del(&priv->napi);
1172 platform_set_drvdata(pdev, NULL);
1173 free_netdev(netdev); 1171 free_netdev(netdev);
1174 return 0; 1172 return 0;
1175} 1173}
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 866b92220c15..9b0c6472bf04 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2024,8 +2024,6 @@ fec_drv_remove(struct platform_device *pdev)
2024 clk_disable_unprepare(fep->clk_ipg); 2024 clk_disable_unprepare(fep->clk_ipg);
2025 free_netdev(ndev); 2025 free_netdev(ndev);
2026 2026
2027 platform_set_drvdata(pdev, NULL);
2028
2029 return 0; 2027 return 0;
2030} 2028}
2031 2029
diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c
index 0b5708520121..64646eb39e8b 100644
--- a/drivers/net/ethernet/korina.c
+++ b/drivers/net/ethernet/korina.c
@@ -1211,7 +1211,6 @@ static int korina_remove(struct platform_device *pdev)
1211 iounmap(lp->rx_dma_regs); 1211 iounmap(lp->rx_dma_regs);
1212 iounmap(lp->tx_dma_regs); 1212 iounmap(lp->tx_dma_regs);
1213 1213
1214 platform_set_drvdata(pdev, NULL);
1215 unregister_netdev(bif->dev); 1214 unregister_netdev(bif->dev);
1216 free_netdev(bif->dev); 1215 free_netdev(bif->dev);
1217 1216
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 2ad1494efbb3..afb8bcbe29f8 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2813,8 +2813,6 @@ static int mv643xx_eth_remove(struct platform_device *pdev)
2813 2813
2814 free_netdev(mp->dev); 2814 free_netdev(mp->dev);
2815 2815
2816 platform_set_drvdata(pdev, NULL);
2817
2818 return 0; 2816 return 0;
2819} 2817}
2820 2818
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c96678555233..cd0ea204ac24 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2804,8 +2804,6 @@ static int mvneta_remove(struct platform_device *pdev)
2804 irq_dispose_mapping(dev->irq); 2804 irq_dispose_mapping(dev->irq);
2805 free_netdev(dev); 2805 free_netdev(dev);
2806 2806
2807 platform_set_drvdata(pdev, NULL);
2808
2809 return 0; 2807 return 0;
2810} 2808}
2811 2809
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 339bb323cb0c..2602cf7ba642 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1602,7 +1602,6 @@ static int pxa168_eth_remove(struct platform_device *pdev)
1602 unregister_netdev(dev); 1602 unregister_netdev(dev);
1603 cancel_work_sync(&pep->tx_timeout_task); 1603 cancel_work_sync(&pep->tx_timeout_task);
1604 free_netdev(dev); 1604 free_netdev(dev);
1605 platform_set_drvdata(pdev, NULL);
1606 return 0; 1605 return 0;
1607} 1606}
1608 1607
diff --git a/drivers/net/ethernet/micrel/ks8695net.c b/drivers/net/ethernet/micrel/ks8695net.c
index b6c60fdef4ff..106eb972f2ac 100644
--- a/drivers/net/ethernet/micrel/ks8695net.c
+++ b/drivers/net/ethernet/micrel/ks8695net.c
@@ -1600,7 +1600,6 @@ ks8695_drv_remove(struct platform_device *pdev)
1600 struct net_device *ndev = platform_get_drvdata(pdev); 1600 struct net_device *ndev = platform_get_drvdata(pdev);
1601 struct ks8695_priv *ksp = netdev_priv(ndev); 1601 struct ks8695_priv *ksp = netdev_priv(ndev);
1602 1602
1603 platform_set_drvdata(pdev, NULL);
1604 netif_napi_del(&ksp->napi); 1603 netif_napi_del(&ksp->napi);
1605 1604
1606 unregister_netdev(ndev); 1605 unregister_netdev(ndev);
diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c
index fbcb9e74d7fc..e393d998be89 100644
--- a/drivers/net/ethernet/micrel/ks8842.c
+++ b/drivers/net/ethernet/micrel/ks8842.c
@@ -1250,7 +1250,6 @@ static int ks8842_remove(struct platform_device *pdev)
1250 iounmap(adapter->hw_addr); 1250 iounmap(adapter->hw_addr);
1251 free_netdev(netdev); 1251 free_netdev(netdev);
1252 release_mem_region(iomem->start, resource_size(iomem)); 1252 release_mem_region(iomem->start, resource_size(iomem));
1253 platform_set_drvdata(pdev, NULL);
1254 return 0; 1253 return 0;
1255} 1254}
1256 1255
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index ddaf138ce0d4..e9b1a830d582 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -1671,7 +1671,6 @@ static int ks8851_remove(struct platform_device *pdev)
1671 iounmap(ks->hw_addr); 1671 iounmap(ks->hw_addr);
1672 free_netdev(netdev); 1672 free_netdev(netdev);
1673 release_mem_region(iomem->start, resource_size(iomem)); 1673 release_mem_region(iomem->start, resource_size(iomem));
1674 platform_set_drvdata(pdev, NULL);
1675 return 0; 1674 return 0;
1676 1675
1677} 1676}
diff --git a/drivers/net/ethernet/netx-eth.c b/drivers/net/ethernet/netx-eth.c
index 5da3ffb61062..dc2c6f561e9a 100644
--- a/drivers/net/ethernet/netx-eth.c
+++ b/drivers/net/ethernet/netx-eth.c
@@ -422,7 +422,6 @@ exit_free_pfifo:
422exit_free_xc: 422exit_free_xc:
423 free_xc(priv->xc); 423 free_xc(priv->xc);
424exit_free_netdev: 424exit_free_netdev:
425 platform_set_drvdata(pdev, NULL);
426 free_netdev(ndev); 425 free_netdev(ndev);
427exit: 426exit:
428 return ret; 427 return ret;
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
index 3df8287b7452..e88bdb1aa669 100644
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c
@@ -1051,7 +1051,6 @@ failed_put_clk:
1051 clk_put(ether->clk); 1051 clk_put(ether->clk);
1052failed_free_rxirq: 1052failed_free_rxirq:
1053 free_irq(ether->rxirq, pdev); 1053 free_irq(ether->rxirq, pdev);
1054 platform_set_drvdata(pdev, NULL);
1055failed_free_txirq: 1054failed_free_txirq:
1056 free_irq(ether->txirq, pdev); 1055 free_irq(ether->txirq, pdev);
1057failed_free_io: 1056failed_free_io:
@@ -1080,7 +1079,6 @@ static int w90p910_ether_remove(struct platform_device *pdev)
1080 free_irq(ether->rxirq, dev); 1079 free_irq(ether->rxirq, dev);
1081 1080
1082 del_timer_sync(&ether->check_timer); 1081 del_timer_sync(&ether->check_timer);
1083 platform_set_drvdata(pdev, NULL);
1084 1082
1085 free_netdev(dev); 1083 free_netdev(dev);
1086 return 0; 1084 return 0;
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 55a5548d6add..a061b93efe66 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1483,7 +1483,6 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
1483 return 0; 1483 return 0;
1484 1484
1485err_out_unregister_netdev: 1485err_out_unregister_netdev:
1486 platform_set_drvdata(pdev, NULL);
1487 unregister_netdev(ndev); 1486 unregister_netdev(ndev);
1488err_out_dma_unmap: 1487err_out_dma_unmap:
1489 if (!use_iram_for_net(&pldat->pdev->dev) || 1488 if (!use_iram_for_net(&pldat->pdev->dev) ||
@@ -1511,7 +1510,6 @@ static int lpc_eth_drv_remove(struct platform_device *pdev)
1511 struct netdata_local *pldat = netdev_priv(ndev); 1510 struct netdata_local *pldat = netdev_priv(ndev);
1512 1511
1513 unregister_netdev(ndev); 1512 unregister_netdev(ndev);
1514 platform_set_drvdata(pdev, NULL);
1515 1513
1516 if (!use_iram_for_net(&pldat->pdev->dev) || 1514 if (!use_iram_for_net(&pldat->pdev->dev) ||
1517 pldat->dma_buff_size > lpc32xx_return_iram_size()) 1515 pldat->dma_buff_size > lpc32xx_return_iram_size())
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 42e9dd05c936..399a7c968e0d 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2803,7 +2803,6 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
2803 unregister_netdev(ndev); 2803 unregister_netdev(ndev);
2804 pm_runtime_disable(&pdev->dev); 2804 pm_runtime_disable(&pdev->dev);
2805 free_netdev(ndev); 2805 free_netdev(ndev);
2806 platform_set_drvdata(pdev, NULL);
2807 2806
2808 return 0; 2807 return 0;
2809} 2808}
diff --git a/drivers/net/ethernet/s6gmac.c b/drivers/net/ethernet/s6gmac.c
index b6739afeaca1..a99739c5142c 100644
--- a/drivers/net/ethernet/s6gmac.c
+++ b/drivers/net/ethernet/s6gmac.c
@@ -1040,7 +1040,6 @@ static int s6gmac_remove(struct platform_device *pdev)
1040 unregister_netdev(dev); 1040 unregister_netdev(dev);
1041 free_irq(dev->irq, dev); 1041 free_irq(dev->irq, dev);
1042 free_netdev(dev); 1042 free_netdev(dev);
1043 platform_set_drvdata(pdev, NULL);
1044 } 1043 }
1045 return 0; 1044 return 0;
1046} 1045}
diff --git a/drivers/net/ethernet/seeq/sgiseeq.c b/drivers/net/ethernet/seeq/sgiseeq.c
index 0ad5694b41f8..856e523ac936 100644
--- a/drivers/net/ethernet/seeq/sgiseeq.c
+++ b/drivers/net/ethernet/seeq/sgiseeq.c
@@ -818,7 +818,6 @@ static int __exit sgiseeq_remove(struct platform_device *pdev)
818 dma_free_noncoherent(&pdev->dev, sizeof(*sp->srings), sp->srings, 818 dma_free_noncoherent(&pdev->dev, sizeof(*sp->srings), sp->srings,
819 sp->srings_dma); 819 sp->srings_dma);
820 free_netdev(dev); 820 free_netdev(dev);
821 platform_set_drvdata(pdev, NULL);
822 821
823 return 0; 822 return 0;
824} 823}
diff --git a/drivers/net/ethernet/sgi/meth.c b/drivers/net/ethernet/sgi/meth.c
index 4bdbaad9932d..9f5f35e041ac 100644
--- a/drivers/net/ethernet/sgi/meth.c
+++ b/drivers/net/ethernet/sgi/meth.c
@@ -863,7 +863,6 @@ static int __exit meth_remove(struct platform_device *pdev)
863 863
864 unregister_netdev(dev); 864 unregister_netdev(dev);
865 free_netdev(dev); 865 free_netdev(dev);
866 platform_set_drvdata(pdev, NULL);
867 866
868 return 0; 867 return 0;
869} 868}
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 9dd842dbb859..345558fe7367 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -2087,7 +2087,6 @@ static int smc911x_drv_probe(struct platform_device *pdev)
2087 ndev->base_addr = res->start; 2087 ndev->base_addr = res->start;
2088 ret = smc911x_probe(ndev); 2088 ret = smc911x_probe(ndev);
2089 if (ret != 0) { 2089 if (ret != 0) {
2090 platform_set_drvdata(pdev, NULL);
2091 iounmap(addr); 2090 iounmap(addr);
2092release_both: 2091release_both:
2093 free_netdev(ndev); 2092 free_netdev(ndev);
@@ -2113,7 +2112,6 @@ static int smc911x_drv_remove(struct platform_device *pdev)
2113 struct resource *res; 2112 struct resource *res;
2114 2113
2115 DBG(SMC_DEBUG_FUNC, "--> %s\n", __func__); 2114 DBG(SMC_DEBUG_FUNC, "--> %s\n", __func__);
2116 platform_set_drvdata(pdev, NULL);
2117 2115
2118 unregister_netdev(ndev); 2116 unregister_netdev(ndev);
2119 2117
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index dfbf978315df..cde13be7c7de 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2299,7 +2299,6 @@ static int smc_drv_probe(struct platform_device *pdev)
2299 return 0; 2299 return 0;
2300 2300
2301 out_iounmap: 2301 out_iounmap:
2302 platform_set_drvdata(pdev, NULL);
2303 iounmap(addr); 2302 iounmap(addr);
2304 out_release_attrib: 2303 out_release_attrib:
2305 smc_release_attrib(pdev, ndev); 2304 smc_release_attrib(pdev, ndev);
@@ -2319,8 +2318,6 @@ static int smc_drv_remove(struct platform_device *pdev)
2319 struct smc_local *lp = netdev_priv(ndev); 2318 struct smc_local *lp = netdev_priv(ndev);
2320 struct resource *res; 2319 struct resource *res;
2321 2320
2322 platform_set_drvdata(pdev, NULL);
2323
2324 unregister_netdev(ndev); 2321 unregister_netdev(ndev);
2325 2322
2326 free_irq(ndev->irq, ndev); 2323 free_irq(ndev->irq, ndev);
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 3663b9e04a31..a1419211585b 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -2284,7 +2284,6 @@ static int smsc911x_drv_remove(struct platform_device *pdev)
2284 mdiobus_unregister(pdata->mii_bus); 2284 mdiobus_unregister(pdata->mii_bus);
2285 mdiobus_free(pdata->mii_bus); 2285 mdiobus_free(pdata->mii_bus);
2286 2286
2287 platform_set_drvdata(pdev, NULL);
2288 unregister_netdev(dev); 2287 unregister_netdev(dev);
2289 free_irq(dev->irq, dev); 2288 free_irq(dev->irq, dev);
2290 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 2289 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
@@ -2539,7 +2538,6 @@ out_disable_resources:
2539out_enable_resources_fail: 2538out_enable_resources_fail:
2540 smsc911x_free_resources(pdev); 2539 smsc911x_free_resources(pdev);
2541out_request_resources_fail: 2540out_request_resources_fail:
2542 platform_set_drvdata(pdev, NULL);
2543 iounmap(pdata->ioaddr); 2541 iounmap(pdata->ioaddr);
2544 free_netdev(dev); 2542 free_netdev(dev);
2545out_release_io_1: 2543out_release_io_1:
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 1d3780f55ba2..17bc7827e7ca 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -171,8 +171,6 @@ static int stmmac_pltfr_remove(struct platform_device *pdev)
171 if (priv->plat->exit) 171 if (priv->plat->exit)
172 priv->plat->exit(pdev); 172 priv->plat->exit(pdev);
173 173
174 platform_set_drvdata(pdev, NULL);
175
176 return ret; 174 return ret;
177} 175}
178 176
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 21a5b291b4b3..89a4c40d6d83 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1940,7 +1940,6 @@ static int cpsw_remove(struct platform_device *pdev)
1940 struct cpsw_priv *priv = netdev_priv(ndev); 1940 struct cpsw_priv *priv = netdev_priv(ndev);
1941 int i; 1941 int i;
1942 1942
1943 platform_set_drvdata(pdev, NULL);
1944 if (priv->data.dual_emac) 1943 if (priv->data.dual_emac)
1945 unregister_netdev(cpsw_get_slave_ndev(priv, 1)); 1944 unregister_netdev(cpsw_get_slave_ndev(priv, 1));
1946 unregister_netdev(ndev); 1945 unregister_netdev(ndev);
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 860e15ddfbcb..efb6f65a8be3 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -2037,8 +2037,6 @@ static int davinci_emac_remove(struct platform_device *pdev)
2037 2037
2038 dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n"); 2038 dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n");
2039 2039
2040 platform_set_drvdata(pdev, NULL);
2041
2042 if (priv->txchan) 2040 if (priv->txchan)
2043 cpdma_chan_destroy(priv->txchan); 2041 cpdma_chan_destroy(priv->txchan);
2044 if (priv->rxchan) 2042 if (priv->rxchan)
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 3c69a0460832..01bdc6ca0755 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -1682,7 +1682,6 @@ static int tsi108_ether_remove(struct platform_device *pdev)
1682 1682
1683 unregister_netdev(dev); 1683 unregister_netdev(dev);
1684 tsi108_stop_ethernet(dev); 1684 tsi108_stop_ethernet(dev);
1685 platform_set_drvdata(pdev, NULL);
1686 iounmap(priv->regs); 1685 iounmap(priv->regs);
1687 iounmap(priv->phyregs); 1686 iounmap(priv->phyregs);
1688 free_netdev(dev); 1687 free_netdev(dev);
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index a518dcab396e..30fed08d1674 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -734,7 +734,6 @@ err_hw_probe:
734 unregister_netdev(ndev); 734 unregister_netdev(ndev);
735err_register: 735err_register:
736 free_netdev(ndev); 736 free_netdev(ndev);
737 platform_set_drvdata(pdev, NULL);
738 return err; 737 return err;
739} 738}
740 739
@@ -750,7 +749,6 @@ static int w5100_remove(struct platform_device *pdev)
750 749
751 unregister_netdev(ndev); 750 unregister_netdev(ndev);
752 free_netdev(ndev); 751 free_netdev(ndev);
753 platform_set_drvdata(pdev, NULL);
754 return 0; 752 return 0;
755} 753}
756 754
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index 6e00e3f94ce4..e92884564e1e 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -646,7 +646,6 @@ err_hw_probe:
646 unregister_netdev(ndev); 646 unregister_netdev(ndev);
647err_register: 647err_register:
648 free_netdev(ndev); 648 free_netdev(ndev);
649 platform_set_drvdata(pdev, NULL);
650 return err; 649 return err;
651} 650}
652 651
@@ -662,7 +661,6 @@ static int w5300_remove(struct platform_device *pdev)
662 661
663 unregister_netdev(ndev); 662 unregister_netdev(ndev);
664 free_netdev(ndev); 663 free_netdev(ndev);
665 platform_set_drvdata(pdev, NULL);
666 return 0; 664 return 0;
667} 665}
668 666
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 6958a5e87703..3d689fcb7917 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1472,7 +1472,6 @@ err_phy_dis:
1472 phy_disconnect(port->phydev); 1472 phy_disconnect(port->phydev);
1473err_free_mem: 1473err_free_mem:
1474 npe_port_tab[NPE_ID(port->id)] = NULL; 1474 npe_port_tab[NPE_ID(port->id)] = NULL;
1475 platform_set_drvdata(pdev, NULL);
1476 release_resource(port->mem_res); 1475 release_resource(port->mem_res);
1477err_npe_rel: 1476err_npe_rel:
1478 npe_release(port->npe); 1477 npe_release(port->npe);
@@ -1489,7 +1488,6 @@ static int eth_remove_one(struct platform_device *pdev)
1489 unregister_netdev(dev); 1488 unregister_netdev(dev);
1490 phy_disconnect(port->phydev); 1489 phy_disconnect(port->phydev);
1491 npe_port_tab[NPE_ID(port->id)] = NULL; 1490 npe_port_tab[NPE_ID(port->id)] = NULL;
1492 platform_set_drvdata(pdev, NULL);
1493 npe_release(port->npe); 1491 npe_release(port->npe);
1494 release_resource(port->mem_res); 1492 release_resource(port->mem_res);
1495 free_netdev(dev); 1493 free_netdev(dev);