mmc: remove unnecessary platform_set_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Mon, 6 May 2013 06:05:21 +0000 (15:05 +0900)
committerChris Ball <cjb@laptop.org>
Sun, 26 May 2013 18:23:23 +0000 (14:23 -0400)
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: Sonic Zhang <sonic.zhang@analog.com>
Acked-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Chris Ball <cjb@laptop.org>
23 files changed:
drivers/mmc/host/android-goldfish.c
drivers/mmc/host/atmel-mci.c
drivers/mmc/host/au1xmmc.c
drivers/mmc/host/bfin_sdh.c
drivers/mmc/host/davinci_mmc.c
drivers/mmc/host/dw_mmc-pltfm.c
drivers/mmc/host/jz4740_mmc.c
drivers/mmc/host/mvsdio.c
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/mxs-mmc.c
drivers/mmc/host/omap.c
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/pxamci.c
drivers/mmc/host/rtsx_pci_sdmmc.c
drivers/mmc/host/sdhci-acpi.c
drivers/mmc/host/sdhci-pltfm.c
drivers/mmc/host/sdhci-pxav2.c
drivers/mmc/host/sdhci-pxav3.c
drivers/mmc/host/sdhci-s3c.c
drivers/mmc/host/sdhci-spear.c
drivers/mmc/host/sh_mmcif.c
drivers/mmc/host/tmio_mmc.c
drivers/mmc/host/wmt-sdmmc.c

index 7780c14704c4df804824fa511d9a25476e184978..8b4e20a3f16cd45c973185eddf7312754ae88be7 100644 (file)
@@ -546,8 +546,6 @@ static int goldfish_mmc_remove(struct platform_device *pdev)
 {
        struct goldfish_mmc_host *host = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        BUG_ON(host == NULL);
 
        mmc_remove_host(host->mmc);
index 7d8e87ad6d6da97cbe7d5150cdab4cf4d8e1f4b2..4aa20531e5f24d941d89d4a4ed190ce2a3ef179c 100644 (file)
@@ -2475,8 +2475,6 @@ static int __exit atmci_remove(struct platform_device *pdev)
        struct atmel_mci        *host = platform_get_drvdata(pdev);
        unsigned int            i;
 
-       platform_set_drvdata(pdev, NULL);
-
        if (host->buffer)
                dma_free_coherent(&pdev->dev, host->buf_size,
                                  host->buffer, host->buf_phys_addr);
index 127a8fade4daa6de02507c24060fb9aa76dab922..df9becdd2e991739010fc62638757bf02387aeda 100644 (file)
@@ -1149,7 +1149,6 @@ static int au1xmmc_remove(struct platform_device *pdev)
                kfree(host->ioarea);
 
                mmc_free_host(host->mmc);
-               platform_set_drvdata(pdev, NULL);
        }
        return 0;
 }
index fb4348c5b6ace996613dd5de99c12105869cc90b..94fae2f1baaf4de39f9c0e929f35c973b8d4b0b5 100644 (file)
@@ -621,8 +621,6 @@ static int sdh_remove(struct platform_device *pdev)
 {
        struct mmc_host *mmc = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (mmc) {
                struct sdh_host *host = mmc_priv(mmc);
 
index 3946a0eb3a0345995b9f292816fdf53825c6d650..b1b8202242ea3158b526a2bb167fec375cb1fcd4 100644 (file)
@@ -1406,7 +1406,6 @@ static int __exit davinci_mmcsd_remove(struct platform_device *pdev)
 {
        struct mmc_davinci_host *host = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
        if (host) {
                mmc_davinci_cpufreq_deregister(host);
 
index 41c27b74b003e5c742cdfcc3d57ba2a002836791..37873f101cdbd6d8d29fcc5636eb2149097bcba8 100644 (file)
@@ -72,7 +72,6 @@ static int dw_mci_pltfm_remove(struct platform_device *pdev)
 {
        struct dw_mci *host = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
        dw_mci_remove(host);
        return 0;
 }
index 2391c6b7a4bb7ce2629d4bf74c7e70b615560392..1c47b3473ce35c1b7c95e7500a47ae590a4a35eb 100644 (file)
@@ -932,7 +932,6 @@ err_release_mem_region:
 err_clk_put:
        clk_put(host->clk);
 err_free_host:
-       platform_set_drvdata(pdev, NULL);
        mmc_free_host(mmc);
 
        return ret;
@@ -960,7 +959,6 @@ static int jz4740_mmc_remove(struct platform_device *pdev)
 
        clk_put(host->clk);
 
-       platform_set_drvdata(pdev, NULL);
        mmc_free_host(host->mmc);
 
        return 0;
index 8960fc846c772c36b5d9bed5ecd06845cad551dd..d08fe6ae9bf8eab6c42a4e2a29e05f9ba224317c 100644 (file)
@@ -827,7 +827,6 @@ static int __exit mvsd_remove(struct platform_device *pdev)
                clk_disable_unprepare(host->clk);
        mmc_free_host(mmc);
 
-       platform_set_drvdata(pdev, NULL);
        return 0;
 }
 
index d5036353bddc1c3dd09667c67fd4519972e90788..786448a10f15e2ce73eb620fbcbb8060ab7ad5d3 100644 (file)
@@ -1219,8 +1219,6 @@ static int mxcmci_remove(struct platform_device *pdev)
        struct mmc_host *mmc = platform_get_drvdata(pdev);
        struct mxcmci_host *host = mmc_priv(mmc);
 
-       platform_set_drvdata(pdev, NULL);
-
        mmc_remove_host(mmc);
 
        if (host->vcc)
index a09ba6e221366e9302e2bd8e1d48b13f25aa3789..c26280469b05004bb1e2f2bf8db7b4daa08ef5b4 100644 (file)
@@ -709,8 +709,6 @@ static int mxs_mmc_remove(struct platform_device *pdev)
 
        mmc_remove_host(mmc);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (ssp->dmach)
                dma_release_channel(ssp->dmach);
 
index 4254975f931d6e210153f5c9ba1de75680edfe2e..4b3e0eb77fe0f7b8cd48448bd24f5079ae588af9 100644 (file)
@@ -1500,8 +1500,6 @@ static int mmc_omap_remove(struct platform_device *pdev)
        struct mmc_omap_host *host = platform_get_drvdata(pdev);
        int i;
 
-       platform_set_drvdata(pdev, NULL);
-
        BUG_ON(host == NULL);
 
        for (i = 0; i < host->nr_slots; i++)
index eccedc7d06a4301169d24187edc1925fe4a49f87..1865321465c40471751f16c6a50ba417cd07171c 100644 (file)
@@ -2047,7 +2047,6 @@ err_irq:
        }
 err1:
        iounmap(host->base);
-       platform_set_drvdata(pdev, NULL);
        mmc_free_host(mmc);
 err_alloc:
        omap_hsmmc_gpio_free(pdata);
@@ -2093,7 +2092,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (res)
                release_mem_region(res->start, resource_size(res));
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index 2b2f65ada22eebd2bd01f5e30f37a1bc1f706449..847b1996ce8ea105eeec31366dad87621a320ee2 100644 (file)
@@ -834,8 +834,6 @@ static int pxamci_remove(struct platform_device *pdev)
        struct mmc_host *mmc = platform_get_drvdata(pdev);
        int gpio_cd = -1, gpio_ro = -1, gpio_power = -1;
 
-       platform_set_drvdata(pdev, NULL);
-
        if (mmc) {
                struct pxamci_host *host = mmc_priv(mmc);
 
index ad13f4240c49b307bd006dfcda4f158a0dbf91bf..82a35b91cdbc874da2fb9227f30a056be2de233a 100644 (file)
@@ -1316,8 +1316,6 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
        mmc_remove_host(mmc);
        mmc_free_host(mmc);
 
-       platform_set_drvdata(pdev, NULL);
-
        dev_dbg(&(pdev->dev),
                ": Realtek PCI-E SDMMC controller has been removed\n");
 
index 706d9cb1a49e1ed794cded2fbbcc033a4a892b9a..b1a6588b50fab54453967aa3a6db7d0b20fef39c 100644 (file)
@@ -262,7 +262,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
        return 0;
 
 err_free:
-       platform_set_drvdata(pdev, NULL);
        sdhci_free_host(c->host);
        return err;
 }
@@ -281,7 +280,6 @@ static int sdhci_acpi_remove(struct platform_device *pdev)
 
        dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0);
        sdhci_remove_host(c->host, dead);
-       platform_set_drvdata(pdev, NULL);
        sdhci_free_host(c->host);
 
        return 0;
index 77821869e66e5e7e1887fdb52042b6620b4bfe02..e7762e5e90486b0f790c955d0bcdd1e664b8c87b 100644 (file)
@@ -200,7 +200,6 @@ void sdhci_pltfm_free(struct platform_device *pdev)
        iounmap(host->ioaddr);
        release_mem_region(iomem->start, resource_size(iomem));
        sdhci_free_host(host);
-       platform_set_drvdata(pdev, NULL);
 }
 EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
 
index 6a3f702a38a614ed2833dadafa2c719889386cb7..98b5145cef7c80a94e9896481185872c86efac48 100644 (file)
@@ -253,8 +253,6 @@ static int sdhci_pxav2_remove(struct platform_device *pdev)
        sdhci_pltfm_free(pdev);
        kfree(pxa);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index 1ae358e0662daa4a955cbe86afd784d56e519fc2..90ee262def69dc4fd73140e8d2f9ef3ddf984e9a 100644 (file)
@@ -339,8 +339,6 @@ static int sdhci_pxav3_remove(struct platform_device *pdev)
        sdhci_pltfm_free(pdev);
        kfree(pxa);
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index c6f6246a4933c1c6c40c4923b052bf39cb9307ed..926aaf6acc678d43e7abc28e96890c18886d6563 100644 (file)
@@ -745,7 +745,6 @@ static int sdhci_s3c_remove(struct platform_device *pdev)
        clk_disable_unprepare(sc->clk_io);
 
        sdhci_free_host(host);
-       platform_set_drvdata(pdev, NULL);
 
        return 0;
 }
index 7ae5b3ae7bad0767ae250ee6c53553befb8240a1..2dba9f8d1760313e3c47eeca756d6a59247ed924 100644 (file)
@@ -258,7 +258,6 @@ static int sdhci_probe(struct platform_device *pdev)
        return 0;
 
 set_drvdata:
-       platform_set_drvdata(pdev, NULL);
        sdhci_remove_host(host, 1);
 free_host:
        sdhci_free_host(host);
@@ -278,7 +277,6 @@ static int sdhci_remove(struct platform_device *pdev)
        int dead = 0;
        u32 scratch;
 
-       platform_set_drvdata(pdev, NULL);
        scratch = readl(host->ioaddr + SDHCI_INT_STATUS);
        if (scratch == (u32)-1)
                dead = 1;
index ba76a532ae3047d5b3b232a3fa69097c5bfb702e..117a1f7747201b71233d991a6d64f103d0dbc3dd 100644 (file)
@@ -1501,8 +1501,6 @@ static int sh_mmcif_remove(struct platform_device *pdev)
        if (irq[1] >= 0)
                free_irq(irq[1], host);
 
-       platform_set_drvdata(pdev, NULL);
-
        clk_disable(host->hclk);
        mmc_free_host(host->mmc);
        pm_runtime_put_sync(&pdev->dev);
index 139212e79cde887fe06a6bfc3f7cb89356df0a25..8860d4d2bc22329cc7d8b5335e537695bfadf213 100644 (file)
@@ -112,8 +112,6 @@ static int tmio_mmc_remove(struct platform_device *pdev)
        const struct mfd_cell *cell = mfd_get_cell(pdev);
        struct mmc_host *mmc = platform_get_drvdata(pdev);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (mmc) {
                struct tmio_mmc_host *host = mmc_priv(mmc);
                free_irq(platform_get_irq(pdev, 0), host);
index 442f5766ffca7dd57b694ae526d4e5f37b98b1c2..34231d5168fcf12dfe804d2a26b3cda2c6647976 100644 (file)
@@ -927,8 +927,6 @@ static int wmt_mci_remove(struct platform_device *pdev)
 
        mmc_free_host(mmc);
 
-       platform_set_drvdata(pdev, NULL);
-
        dev_info(&pdev->dev, "WMT MCI device removed\n");
 
        return 0;