net: ethernet: remove unnecessary platform_set_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Mon, 27 May 2013 19:01:12 +0000 (19:01 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 May 2013 05:34:51 +0000 (22:34 -0700)
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>
37 files changed:
drivers/net/ethernet/8390/ne.c
drivers/net/ethernet/adi/bfin_mac.c
drivers/net/ethernet/amd/au1000_eth.c
drivers/net/ethernet/broadcom/bcm63xx_enet.c
drivers/net/ethernet/cadence/at91_ether.c
drivers/net/ethernet/cadence/macb.c
drivers/net/ethernet/calxeda/xgmac.c
drivers/net/ethernet/cirrus/ep93xx_eth.c
drivers/net/ethernet/davicom/dm9000.c
drivers/net/ethernet/ethoc.c
drivers/net/ethernet/faraday/ftgmac100.c
drivers/net/ethernet/faraday/ftmac100.c
drivers/net/ethernet/freescale/fec_main.c
drivers/net/ethernet/korina.c
drivers/net/ethernet/marvell/mv643xx_eth.c
drivers/net/ethernet/marvell/mvneta.c
drivers/net/ethernet/marvell/pxa168_eth.c
drivers/net/ethernet/micrel/ks8695net.c
drivers/net/ethernet/micrel/ks8842.c
drivers/net/ethernet/micrel/ks8851_mll.c
drivers/net/ethernet/netx-eth.c
drivers/net/ethernet/nuvoton/w90p910_ether.c
drivers/net/ethernet/nxp/lpc_eth.c
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/s6gmac.c
drivers/net/ethernet/seeq/sgiseeq.c
drivers/net/ethernet/sgi/meth.c
drivers/net/ethernet/smsc/smc911x.c
drivers/net/ethernet/smsc/smc91x.c
drivers/net/ethernet/smsc/smsc911x.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
drivers/net/ethernet/ti/cpsw.c
drivers/net/ethernet/ti/davinci_emac.c
drivers/net/ethernet/tundra/tsi108_eth.c
drivers/net/ethernet/wiznet/w5100.c
drivers/net/ethernet/wiznet/w5300.c
drivers/net/ethernet/xscale/ixp4xx_eth.c

index 47618e505355ae91fc0ade4e50231ec780bcc56f..b2e8405137357f2cef6303c1a9a16d96b1abb23d 100644 (file)
@@ -849,7 +849,6 @@ static int ne_drv_remove(struct platform_device *pdev)
                free_irq(dev->irq, dev);
                release_region(dev->base_addr, NE_IO_EXTENT);
                free_netdev(dev);
-               platform_set_drvdata(pdev, NULL);
        }
        return 0;
 }
index dada66bfe0d6e018778ba24939f15b82e9468b0d..e904b3838dccef44ace7fb126c32e9cd706597a9 100644 (file)
@@ -1719,7 +1719,6 @@ out_err_mii_probe:
        mdiobus_unregister(lp->mii_bus);
        mdiobus_free(lp->mii_bus);
 out_err_probe_mac:
-       platform_set_drvdata(pdev, NULL);
        free_netdev(ndev);
 
        return rc;
@@ -1732,8 +1731,6 @@ static int bfin_mac_remove(struct platform_device *pdev)
 
        bfin_phc_release(lp);
 
-       platform_set_drvdata(pdev, NULL);
-
        lp->mii_bus->priv = NULL;
 
        unregister_netdev(ndev);
@@ -1868,7 +1865,6 @@ static int bfin_mii_bus_remove(struct platform_device *pdev)
        struct bfin_mii_bus_platform_data *mii_bus_pd =
                dev_get_platdata(&pdev->dev);
 
-       platform_set_drvdata(pdev, NULL);
        mdiobus_unregister(miibus);
        kfree(miibus->irq);
        mdiobus_free(miibus);
index 688aede742c7d0068d061f377582253f52280d12..ceb45bc963a93d8ba9cb2c554ff2c002ec6c916c 100644 (file)
@@ -1301,8 +1301,6 @@ static int au1000_remove(struct platform_device *pdev)
        int i;
        struct resource *base, *macen;
 
-       platform_set_drvdata(pdev, NULL);
-
        unregister_netdev(dev);
        mdiobus_unregister(aup->mii_bus);
        mdiobus_free(aup->mii_bus);
index 0b3e23ec37f769dde56f47f475b262c5c101f35d..e46466cb3627ee1297b4b5b9cfa0e8fbe8fa2e60 100644 (file)
@@ -1847,7 +1847,6 @@ static int bcm_enet_remove(struct platform_device *pdev)
        clk_disable_unprepare(priv->mac_clk);
        clk_put(priv->mac_clk);
 
-       platform_set_drvdata(pdev, NULL);
        free_netdev(dev);
        return 0;
 }
index cc9a185f0abbc03dfb9265a86a2d9fa13b07ba10..3f1957158a3bc876839d0613f1cbb0e7079687a5 100644 (file)
@@ -435,7 +435,6 @@ static int at91ether_remove(struct platform_device *pdev)
        unregister_netdev(dev);
        clk_disable(lp->pclk);
        free_netdev(dev);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index c89aa41dd44873f02fbea97c6af3f3cd6132dcbd..4465e27ba9d1303e82bb431a34f68d078b0e051f 100644 (file)
@@ -1649,7 +1649,6 @@ err_out_put_pclk:
 err_out_free_dev:
        free_netdev(dev);
 err_out:
-       platform_set_drvdata(pdev, NULL);
        return err;
 }
 
@@ -1675,7 +1674,6 @@ static int __exit macb_remove(struct platform_device *pdev)
                clk_disable_unprepare(bp->pclk);
                clk_put(bp->pclk);
                free_netdev(dev);
-               platform_set_drvdata(pdev, NULL);
        }
 
        return 0;
index 4a1f2fa812abea3e32ce97880b0c1ea5f41287b8..7cb148c495c900ad4385ed3c59db7f63f389821b 100644 (file)
@@ -1790,7 +1790,6 @@ err_io:
        free_netdev(ndev);
 err_alloc:
        release_mem_region(res->start, resource_size(res));
-       platform_set_drvdata(pdev, NULL);
        return ret;
 }
 
@@ -1813,7 +1812,6 @@ static int xgmac_remove(struct platform_device *pdev)
        free_irq(ndev->irq, ndev);
        free_irq(priv->pmt_irq, ndev);
 
-       platform_set_drvdata(pdev, NULL);
        unregister_netdev(ndev);
        netif_napi_del(&priv->napi);
 
index 67b0388b6e68223d2281bacb8f69aa330f2193fa..e3d4ec836f8bee3f31b41a7502966470edd90655 100644 (file)
@@ -783,7 +783,6 @@ static int ep93xx_eth_remove(struct platform_device *pdev)
        dev = platform_get_drvdata(pdev);
        if (dev == NULL)
                return 0;
-       platform_set_drvdata(pdev, NULL);
 
        ep = netdev_priv(dev);
 
index dd243a1b03e0cc686bd741b6581fcc82e5d5a509..a13b312b50f20dfd544d88a338bd4263a4a716af 100644 (file)
@@ -1699,8 +1699,6 @@ dm9000_drv_remove(struct platform_device *pdev)
 {
        struct net_device *ndev = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        unregister_netdev(ndev);
        dm9000_release_board(pdev, netdev_priv(ndev));
        free_netdev(ndev);              /* free device structure */
index 5722bc61fa582d0796a4ce37b2e8912c4840cc59..cf579fb39bc5cf575f217902b725052d34456d0e 100644 (file)
@@ -1147,8 +1147,6 @@ static int ethoc_remove(struct platform_device *pdev)
        struct net_device *netdev = platform_get_drvdata(pdev);
        struct ethoc *priv = netdev_priv(netdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (netdev) {
                netif_napi_del(&priv->napi);
                phy_disconnect(priv->phy);
index 21b85fb7d05f68da25f7980b937e61b1c4d9de56..934e1ae279f01ac85ce0ddb221470a9aeebab7d5 100644 (file)
@@ -1311,7 +1311,6 @@ err_ioremap:
        release_resource(priv->res);
 err_req_mem:
        netif_napi_del(&priv->napi);
-       platform_set_drvdata(pdev, NULL);
        free_netdev(netdev);
 err_alloc_etherdev:
        return err;
@@ -1335,7 +1334,6 @@ static int __exit ftgmac100_remove(struct platform_device *pdev)
        release_resource(priv->res);
 
        netif_napi_del(&priv->napi);
-       platform_set_drvdata(pdev, NULL);
        free_netdev(netdev);
        return 0;
 }
index a6eda8d83138bd791769ba9e45bccf5c1f88c00e..4658f4cc196933226f0488ab15d0a956e40354e4 100644 (file)
@@ -1149,7 +1149,6 @@ err_ioremap:
        release_resource(priv->res);
 err_req_mem:
        netif_napi_del(&priv->napi);
-       platform_set_drvdata(pdev, NULL);
        free_netdev(netdev);
 err_alloc_etherdev:
        return err;
@@ -1169,7 +1168,6 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
        release_resource(priv->res);
 
        netif_napi_del(&priv->napi);
-       platform_set_drvdata(pdev, NULL);
        free_netdev(netdev);
        return 0;
 }
index 866b92220c151ccbe7a9f681ab8bef93fa4a8136..9b0c6472bf043c8453c907837f6d41303700a33c 100644 (file)
@@ -2024,8 +2024,6 @@ fec_drv_remove(struct platform_device *pdev)
        clk_disable_unprepare(fep->clk_ipg);
        free_netdev(ndev);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index 0b57085201211583e16f3f4d86f640d9536c1b09..64646eb39e8bc23f31454041e68959bf0b4e6f32 100644 (file)
@@ -1211,7 +1211,6 @@ static int korina_remove(struct platform_device *pdev)
        iounmap(lp->rx_dma_regs);
        iounmap(lp->tx_dma_regs);
 
-       platform_set_drvdata(pdev, NULL);
        unregister_netdev(bif->dev);
        free_netdev(bif->dev);
 
index 2ad1494efbb3021e796481da6c4f48f21e63ca30..afb8bcbe29f89d832608a77f176b9a03a627ad50 100644 (file)
@@ -2813,8 +2813,6 @@ static int mv643xx_eth_remove(struct platform_device *pdev)
 
        free_netdev(mp->dev);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index c96678555233c4afc1336c012c17c3b0da943060..cd0ea204ac240d51f87b60c6642d187967e4f7ed 100644 (file)
@@ -2804,8 +2804,6 @@ static int mvneta_remove(struct platform_device *pdev)
        irq_dispose_mapping(dev->irq);
        free_netdev(dev);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index 339bb323cb0c99c91bf2741cbfea918e7ae4499d..2602cf7ba64214d5cd64760dc7df9e4012fc9c83 100644 (file)
@@ -1602,7 +1602,6 @@ static int pxa168_eth_remove(struct platform_device *pdev)
        unregister_netdev(dev);
        cancel_work_sync(&pep->tx_timeout_task);
        free_netdev(dev);
-       platform_set_drvdata(pdev, NULL);
        return 0;
 }
 
index b6c60fdef4ff6d1d5498e1bfb688b4edfa7ad8bd..106eb972f2acade4f52ebdd6ceed74f6cac7c5bd 100644 (file)
@@ -1600,7 +1600,6 @@ ks8695_drv_remove(struct platform_device *pdev)
        struct net_device *ndev = platform_get_drvdata(pdev);
        struct ks8695_priv *ksp = netdev_priv(ndev);
 
-       platform_set_drvdata(pdev, NULL);
        netif_napi_del(&ksp->napi);
 
        unregister_netdev(ndev);
index fbcb9e74d7fc598f1fe52951a087603f58e11efc..e393d998be89dd2128fccaef65efd36a92c09d26 100644 (file)
@@ -1250,7 +1250,6 @@ static int ks8842_remove(struct platform_device *pdev)
        iounmap(adapter->hw_addr);
        free_netdev(netdev);
        release_mem_region(iomem->start, resource_size(iomem));
-       platform_set_drvdata(pdev, NULL);
        return 0;
 }
 
index ddaf138ce0d4aa79344584f938dad12047a73c97..e9b1a830d582e192b8d505109cb0ea44617de1c6 100644 (file)
@@ -1671,7 +1671,6 @@ static int ks8851_remove(struct platform_device *pdev)
        iounmap(ks->hw_addr);
        free_netdev(netdev);
        release_mem_region(iomem->start, resource_size(iomem));
-       platform_set_drvdata(pdev, NULL);
        return 0;
 
 }
index 5da3ffb610624c3908bd5bbed2f6b2dd85587151..dc2c6f561e9ade6175fb72bf187db05e528d17f7 100644 (file)
@@ -422,7 +422,6 @@ exit_free_pfifo:
 exit_free_xc:
        free_xc(priv->xc);
 exit_free_netdev:
-       platform_set_drvdata(pdev, NULL);
        free_netdev(ndev);
 exit:
        return ret;
index 3df8287b7452d77b69bee0262a9f950125020b8e..e88bdb1aa669c1f60c9b161f2b81fb10150c7777 100644 (file)
@@ -1051,7 +1051,6 @@ failed_put_clk:
        clk_put(ether->clk);
 failed_free_rxirq:
        free_irq(ether->rxirq, pdev);
-       platform_set_drvdata(pdev, NULL);
 failed_free_txirq:
        free_irq(ether->txirq, pdev);
 failed_free_io:
@@ -1080,7 +1079,6 @@ static int w90p910_ether_remove(struct platform_device *pdev)
        free_irq(ether->rxirq, dev);
 
        del_timer_sync(&ether->check_timer);
-       platform_set_drvdata(pdev, NULL);
 
        free_netdev(dev);
        return 0;
index 55a5548d6add50d43202cc74b46acd37934e556a..a061b93efe66a29fd663a49bf16d1a510ff0879f 100644 (file)
@@ -1483,7 +1483,6 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
        return 0;
 
 err_out_unregister_netdev:
-       platform_set_drvdata(pdev, NULL);
        unregister_netdev(ndev);
 err_out_dma_unmap:
        if (!use_iram_for_net(&pldat->pdev->dev) ||
@@ -1511,7 +1510,6 @@ static int lpc_eth_drv_remove(struct platform_device *pdev)
        struct netdata_local *pldat = netdev_priv(ndev);
 
        unregister_netdev(ndev);
-       platform_set_drvdata(pdev, NULL);
 
        if (!use_iram_for_net(&pldat->pdev->dev) ||
            pldat->dma_buff_size > lpc32xx_return_iram_size())
index 42e9dd05c936df55e2bc62754259e1ff6e81785d..399a7c968e0d4d9e2ab48052c8f25819aac23db8 100644 (file)
@@ -2803,7 +2803,6 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
        unregister_netdev(ndev);
        pm_runtime_disable(&pdev->dev);
        free_netdev(ndev);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index b6739afeaca1517bf3351dae9e3a33469cccc46e..a99739c5142cb1f296a7fa8ea83a4efca8f68ea6 100644 (file)
@@ -1040,7 +1040,6 @@ static int s6gmac_remove(struct platform_device *pdev)
                unregister_netdev(dev);
                free_irq(dev->irq, dev);
                free_netdev(dev);
-               platform_set_drvdata(pdev, NULL);
        }
        return 0;
 }
index 0ad5694b41f8eb12d43d2e518b89607ef373bbea..856e523ac936edfbd4f32c55335fc13b1e2443d8 100644 (file)
@@ -818,7 +818,6 @@ static int __exit sgiseeq_remove(struct platform_device *pdev)
        dma_free_noncoherent(&pdev->dev, sizeof(*sp->srings), sp->srings,
                             sp->srings_dma);
        free_netdev(dev);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index 4bdbaad9932df37f1fb92e8eb3c5e76bc2efc6be..9f5f35e041ac599681576aa06b9ee24033cfbd12 100644 (file)
@@ -863,7 +863,6 @@ static int __exit meth_remove(struct platform_device *pdev)
 
        unregister_netdev(dev);
        free_netdev(dev);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index 9dd842dbb8598b9d7825637238ce2d64aaa53f4a..345558fe7367fdeee216642981b0c632f734d9c0 100644 (file)
@@ -2087,7 +2087,6 @@ static int smc911x_drv_probe(struct platform_device *pdev)
        ndev->base_addr = res->start;
        ret = smc911x_probe(ndev);
        if (ret != 0) {
-               platform_set_drvdata(pdev, NULL);
                iounmap(addr);
 release_both:
                free_netdev(ndev);
@@ -2113,7 +2112,6 @@ static int smc911x_drv_remove(struct platform_device *pdev)
        struct resource *res;
 
        DBG(SMC_DEBUG_FUNC, "--> %s\n", __func__);
-       platform_set_drvdata(pdev, NULL);
 
        unregister_netdev(ndev);
 
index dfbf978315dfb31a8cbbd01ce5beae06abc5f398..cde13be7c7ded5e5fc7265052693f6281dd7cd97 100644 (file)
@@ -2299,7 +2299,6 @@ static int smc_drv_probe(struct platform_device *pdev)
        return 0;
 
  out_iounmap:
-       platform_set_drvdata(pdev, NULL);
        iounmap(addr);
  out_release_attrib:
        smc_release_attrib(pdev, ndev);
@@ -2319,8 +2318,6 @@ static int smc_drv_remove(struct platform_device *pdev)
        struct smc_local *lp = netdev_priv(ndev);
        struct resource *res;
 
-       platform_set_drvdata(pdev, NULL);
-
        unregister_netdev(ndev);
 
        free_irq(ndev->irq, ndev);
index 3663b9e04a31345b3a0a02ba28e8c9111de11737..a1419211585bb150188262adec08291ad0a82f38 100644 (file)
@@ -2284,7 +2284,6 @@ static int smsc911x_drv_remove(struct platform_device *pdev)
        mdiobus_unregister(pdata->mii_bus);
        mdiobus_free(pdata->mii_bus);
 
-       platform_set_drvdata(pdev, NULL);
        unregister_netdev(dev);
        free_irq(dev->irq, dev);
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
@@ -2539,7 +2538,6 @@ out_disable_resources:
 out_enable_resources_fail:
        smsc911x_free_resources(pdev);
 out_request_resources_fail:
-       platform_set_drvdata(pdev, NULL);
        iounmap(pdata->ioaddr);
        free_netdev(dev);
 out_release_io_1:
index 1d3780f55ba2c9397641b1b5986b952680259e0c..17bc7827e7cafded7ce96bb4a024ac6d8ebf525d 100644 (file)
@@ -171,8 +171,6 @@ static int stmmac_pltfr_remove(struct platform_device *pdev)
        if (priv->plat->exit)
                priv->plat->exit(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        return ret;
 }
 
index 21a5b291b4b39d0ae65dcd8766c9e51a25665dee..89a4c40d6d8342b8737311121515f705fbdecbe6 100644 (file)
@@ -1940,7 +1940,6 @@ static int cpsw_remove(struct platform_device *pdev)
        struct cpsw_priv *priv = netdev_priv(ndev);
        int i;
 
-       platform_set_drvdata(pdev, NULL);
        if (priv->data.dual_emac)
                unregister_netdev(cpsw_get_slave_ndev(priv, 1));
        unregister_netdev(ndev);
index 860e15ddfbcbcd7232da1c71779793442d72a1c1..efb6f65a8be3d12d947e96d53bccd99f940f00f4 100644 (file)
@@ -2037,8 +2037,6 @@ static int davinci_emac_remove(struct platform_device *pdev)
 
        dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n");
 
-       platform_set_drvdata(pdev, NULL);
-
        if (priv->txchan)
                cpdma_chan_destroy(priv->txchan);
        if (priv->rxchan)
index 3c69a04608324c8c16bc33cee78f03f524329018..01bdc6ca0755feff940d8bede196ba83d85c2f06 100644 (file)
@@ -1682,7 +1682,6 @@ static int tsi108_ether_remove(struct platform_device *pdev)
 
        unregister_netdev(dev);
        tsi108_stop_ethernet(dev);
-       platform_set_drvdata(pdev, NULL);
        iounmap(priv->regs);
        iounmap(priv->phyregs);
        free_netdev(dev);
index a518dcab396e69cdbd96b8133bef82e237c5daf3..30fed08d1674377bf5b51d6461ef0b13b229cfff 100644 (file)
@@ -734,7 +734,6 @@ err_hw_probe:
        unregister_netdev(ndev);
 err_register:
        free_netdev(ndev);
-       platform_set_drvdata(pdev, NULL);
        return err;
 }
 
@@ -750,7 +749,6 @@ static int w5100_remove(struct platform_device *pdev)
 
        unregister_netdev(ndev);
        free_netdev(ndev);
-       platform_set_drvdata(pdev, NULL);
        return 0;
 }
 
index 6e00e3f94ce4e4909d9b624b710f888039f68ded..e92884564e1e97c43c0a95769b8db950e244bfe5 100644 (file)
@@ -646,7 +646,6 @@ err_hw_probe:
        unregister_netdev(ndev);
 err_register:
        free_netdev(ndev);
-       platform_set_drvdata(pdev, NULL);
        return err;
 }
 
@@ -662,7 +661,6 @@ static int w5300_remove(struct platform_device *pdev)
 
        unregister_netdev(ndev);
        free_netdev(ndev);
-       platform_set_drvdata(pdev, NULL);
        return 0;
 }
 
index 6958a5e87703bb3625b917bcdecfe8a7ef50e7e9..3d689fcb7917bd62e193fc1c8414d2a9075e0be5 100644 (file)
@@ -1472,7 +1472,6 @@ err_phy_dis:
        phy_disconnect(port->phydev);
 err_free_mem:
        npe_port_tab[NPE_ID(port->id)] = NULL;
-       platform_set_drvdata(pdev, NULL);
        release_resource(port->mem_res);
 err_npe_rel:
        npe_release(port->npe);
@@ -1489,7 +1488,6 @@ static int eth_remove_one(struct platform_device *pdev)
        unregister_netdev(dev);
        phy_disconnect(port->phydev);
        npe_port_tab[NPE_ID(port->id)] = NULL;
-       platform_set_drvdata(pdev, NULL);
        npe_release(port->npe);
        release_resource(port->mem_res);
        free_netdev(dev);