aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-05-06 02:05:21 -0400
committerChris Ball <cjb@laptop.org>2013-05-26 14:23:23 -0400
commit113a87f868b2f2e086790a68e8b9e41d8f0c3295 (patch)
tree1481c2f7d8e8cc38248c84017dc12cd0f1fc0b1a /drivers
parentad82ab65d8abd060b60d99b8559da99c31515a31 (diff)
mmc: 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: 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/android-goldfish.c2
-rw-r--r--drivers/mmc/host/atmel-mci.c2
-rw-r--r--drivers/mmc/host/au1xmmc.c1
-rw-r--r--drivers/mmc/host/bfin_sdh.c2
-rw-r--r--drivers/mmc/host/davinci_mmc.c1
-rw-r--r--drivers/mmc/host/dw_mmc-pltfm.c1
-rw-r--r--drivers/mmc/host/jz4740_mmc.c2
-rw-r--r--drivers/mmc/host/mvsdio.c1
-rw-r--r--drivers/mmc/host/mxcmmc.c2
-rw-r--r--drivers/mmc/host/mxs-mmc.c2
-rw-r--r--drivers/mmc/host/omap.c2
-rw-r--r--drivers/mmc/host/omap_hsmmc.c2
-rw-r--r--drivers/mmc/host/pxamci.c2
-rw-r--r--drivers/mmc/host/rtsx_pci_sdmmc.c2
-rw-r--r--drivers/mmc/host/sdhci-acpi.c2
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c1
-rw-r--r--drivers/mmc/host/sdhci-pxav2.c2
-rw-r--r--drivers/mmc/host/sdhci-pxav3.c2
-rw-r--r--drivers/mmc/host/sdhci-s3c.c1
-rw-r--r--drivers/mmc/host/sdhci-spear.c2
-rw-r--r--drivers/mmc/host/sh_mmcif.c2
-rw-r--r--drivers/mmc/host/tmio_mmc.c2
-rw-r--r--drivers/mmc/host/wmt-sdmmc.c2
23 files changed, 0 insertions, 40 deletions
diff --git a/drivers/mmc/host/android-goldfish.c b/drivers/mmc/host/android-goldfish.c
index 7780c14704c4..8b4e20a3f16c 100644
--- a/drivers/mmc/host/android-goldfish.c
+++ b/drivers/mmc/host/android-goldfish.c
@@ -546,8 +546,6 @@ static int goldfish_mmc_remove(struct platform_device *pdev)
546{ 546{
547 struct goldfish_mmc_host *host = platform_get_drvdata(pdev); 547 struct goldfish_mmc_host *host = platform_get_drvdata(pdev);
548 548
549 platform_set_drvdata(pdev, NULL);
550
551 BUG_ON(host == NULL); 549 BUG_ON(host == NULL);
552 550
553 mmc_remove_host(host->mmc); 551 mmc_remove_host(host->mmc);
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 7d8e87ad6d6d..4aa20531e5f2 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2475,8 +2475,6 @@ static int __exit atmci_remove(struct platform_device *pdev)
2475 struct atmel_mci *host = platform_get_drvdata(pdev); 2475 struct atmel_mci *host = platform_get_drvdata(pdev);
2476 unsigned int i; 2476 unsigned int i;
2477 2477
2478 platform_set_drvdata(pdev, NULL);
2479
2480 if (host->buffer) 2478 if (host->buffer)
2481 dma_free_coherent(&pdev->dev, host->buf_size, 2479 dma_free_coherent(&pdev->dev, host->buf_size,
2482 host->buffer, host->buf_phys_addr); 2480 host->buffer, host->buf_phys_addr);
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c
index 127a8fade4da..df9becdd2e99 100644
--- a/drivers/mmc/host/au1xmmc.c
+++ b/drivers/mmc/host/au1xmmc.c
@@ -1149,7 +1149,6 @@ static int au1xmmc_remove(struct platform_device *pdev)
1149 kfree(host->ioarea); 1149 kfree(host->ioarea);
1150 1150
1151 mmc_free_host(host->mmc); 1151 mmc_free_host(host->mmc);
1152 platform_set_drvdata(pdev, NULL);
1153 } 1152 }
1154 return 0; 1153 return 0;
1155} 1154}
diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c
index fb4348c5b6ac..94fae2f1baaf 100644
--- a/drivers/mmc/host/bfin_sdh.c
+++ b/drivers/mmc/host/bfin_sdh.c
@@ -621,8 +621,6 @@ static int sdh_remove(struct platform_device *pdev)
621{ 621{
622 struct mmc_host *mmc = platform_get_drvdata(pdev); 622 struct mmc_host *mmc = platform_get_drvdata(pdev);
623 623
624 platform_set_drvdata(pdev, NULL);
625
626 if (mmc) { 624 if (mmc) {
627 struct sdh_host *host = mmc_priv(mmc); 625 struct sdh_host *host = mmc_priv(mmc);
628 626
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 3946a0eb3a03..b1b8202242ea 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1406,7 +1406,6 @@ static int __exit davinci_mmcsd_remove(struct platform_device *pdev)
1406{ 1406{
1407 struct mmc_davinci_host *host = platform_get_drvdata(pdev); 1407 struct mmc_davinci_host *host = platform_get_drvdata(pdev);
1408 1408
1409 platform_set_drvdata(pdev, NULL);
1410 if (host) { 1409 if (host) {
1411 mmc_davinci_cpufreq_deregister(host); 1410 mmc_davinci_cpufreq_deregister(host);
1412 1411
diff --git a/drivers/mmc/host/dw_mmc-pltfm.c b/drivers/mmc/host/dw_mmc-pltfm.c
index 41c27b74b003..37873f101cdb 100644
--- a/drivers/mmc/host/dw_mmc-pltfm.c
+++ b/drivers/mmc/host/dw_mmc-pltfm.c
@@ -72,7 +72,6 @@ static int dw_mci_pltfm_remove(struct platform_device *pdev)
72{ 72{
73 struct dw_mci *host = platform_get_drvdata(pdev); 73 struct dw_mci *host = platform_get_drvdata(pdev);
74 74
75 platform_set_drvdata(pdev, NULL);
76 dw_mci_remove(host); 75 dw_mci_remove(host);
77 return 0; 76 return 0;
78} 77}
diff --git a/drivers/mmc/host/jz4740_mmc.c b/drivers/mmc/host/jz4740_mmc.c
index 2391c6b7a4bb..1c47b3473ce3 100644
--- a/drivers/mmc/host/jz4740_mmc.c
+++ b/drivers/mmc/host/jz4740_mmc.c
@@ -932,7 +932,6 @@ err_release_mem_region:
932err_clk_put: 932err_clk_put:
933 clk_put(host->clk); 933 clk_put(host->clk);
934err_free_host: 934err_free_host:
935 platform_set_drvdata(pdev, NULL);
936 mmc_free_host(mmc); 935 mmc_free_host(mmc);
937 936
938 return ret; 937 return ret;
@@ -960,7 +959,6 @@ static int jz4740_mmc_remove(struct platform_device *pdev)
960 959
961 clk_put(host->clk); 960 clk_put(host->clk);
962 961
963 platform_set_drvdata(pdev, NULL);
964 mmc_free_host(host->mmc); 962 mmc_free_host(host->mmc);
965 963
966 return 0; 964 return 0;
diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 8960fc846c77..d08fe6ae9bf8 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -827,7 +827,6 @@ static int __exit mvsd_remove(struct platform_device *pdev)
827 clk_disable_unprepare(host->clk); 827 clk_disable_unprepare(host->clk);
828 mmc_free_host(mmc); 828 mmc_free_host(mmc);
829 829
830 platform_set_drvdata(pdev, NULL);
831 return 0; 830 return 0;
832} 831}
833 832
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index d5036353bddc..786448a10f15 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -1219,8 +1219,6 @@ static int mxcmci_remove(struct platform_device *pdev)
1219 struct mmc_host *mmc = platform_get_drvdata(pdev); 1219 struct mmc_host *mmc = platform_get_drvdata(pdev);
1220 struct mxcmci_host *host = mmc_priv(mmc); 1220 struct mxcmci_host *host = mmc_priv(mmc);
1221 1221
1222 platform_set_drvdata(pdev, NULL);
1223
1224 mmc_remove_host(mmc); 1222 mmc_remove_host(mmc);
1225 1223
1226 if (host->vcc) 1224 if (host->vcc)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index a09ba6e22136..c26280469b05 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -709,8 +709,6 @@ static int mxs_mmc_remove(struct platform_device *pdev)
709 709
710 mmc_remove_host(mmc); 710 mmc_remove_host(mmc);
711 711
712 platform_set_drvdata(pdev, NULL);
713
714 if (ssp->dmach) 712 if (ssp->dmach)
715 dma_release_channel(ssp->dmach); 713 dma_release_channel(ssp->dmach);
716 714
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 4254975f931d..4b3e0eb77fe0 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1500,8 +1500,6 @@ static int mmc_omap_remove(struct platform_device *pdev)
1500 struct mmc_omap_host *host = platform_get_drvdata(pdev); 1500 struct mmc_omap_host *host = platform_get_drvdata(pdev);
1501 int i; 1501 int i;
1502 1502
1503 platform_set_drvdata(pdev, NULL);
1504
1505 BUG_ON(host == NULL); 1503 BUG_ON(host == NULL);
1506 1504
1507 for (i = 0; i < host->nr_slots; i++) 1505 for (i = 0; i < host->nr_slots; i++)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index eccedc7d06a4..1865321465c4 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2047,7 +2047,6 @@ err_irq:
2047 } 2047 }
2048err1: 2048err1:
2049 iounmap(host->base); 2049 iounmap(host->base);
2050 platform_set_drvdata(pdev, NULL);
2051 mmc_free_host(mmc); 2050 mmc_free_host(mmc);
2052err_alloc: 2051err_alloc:
2053 omap_hsmmc_gpio_free(pdata); 2052 omap_hsmmc_gpio_free(pdata);
@@ -2093,7 +2092,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
2093 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2092 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2094 if (res) 2093 if (res)
2095 release_mem_region(res->start, resource_size(res)); 2094 release_mem_region(res->start, resource_size(res));
2096 platform_set_drvdata(pdev, NULL);
2097 2095
2098 return 0; 2096 return 0;
2099} 2097}
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 2b2f65ada22e..847b1996ce8e 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -834,8 +834,6 @@ static int pxamci_remove(struct platform_device *pdev)
834 struct mmc_host *mmc = platform_get_drvdata(pdev); 834 struct mmc_host *mmc = platform_get_drvdata(pdev);
835 int gpio_cd = -1, gpio_ro = -1, gpio_power = -1; 835 int gpio_cd = -1, gpio_ro = -1, gpio_power = -1;
836 836
837 platform_set_drvdata(pdev, NULL);
838
839 if (mmc) { 837 if (mmc) {
840 struct pxamci_host *host = mmc_priv(mmc); 838 struct pxamci_host *host = mmc_priv(mmc);
841 839
diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index ad13f4240c49..82a35b91cdbc 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -1316,8 +1316,6 @@ static int rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
1316 mmc_remove_host(mmc); 1316 mmc_remove_host(mmc);
1317 mmc_free_host(mmc); 1317 mmc_free_host(mmc);
1318 1318
1319 platform_set_drvdata(pdev, NULL);
1320
1321 dev_dbg(&(pdev->dev), 1319 dev_dbg(&(pdev->dev),
1322 ": Realtek PCI-E SDMMC controller has been removed\n"); 1320 ": Realtek PCI-E SDMMC controller has been removed\n");
1323 1321
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 706d9cb1a49e..b1a6588b50fa 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -262,7 +262,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
262 return 0; 262 return 0;
263 263
264err_free: 264err_free:
265 platform_set_drvdata(pdev, NULL);
266 sdhci_free_host(c->host); 265 sdhci_free_host(c->host);
267 return err; 266 return err;
268} 267}
@@ -281,7 +280,6 @@ static int sdhci_acpi_remove(struct platform_device *pdev)
281 280
282 dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); 281 dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0);
283 sdhci_remove_host(c->host, dead); 282 sdhci_remove_host(c->host, dead);
284 platform_set_drvdata(pdev, NULL);
285 sdhci_free_host(c->host); 283 sdhci_free_host(c->host);
286 284
287 return 0; 285 return 0;
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 77821869e66e..e7762e5e9048 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -200,7 +200,6 @@ void sdhci_pltfm_free(struct platform_device *pdev)
200 iounmap(host->ioaddr); 200 iounmap(host->ioaddr);
201 release_mem_region(iomem->start, resource_size(iomem)); 201 release_mem_region(iomem->start, resource_size(iomem));
202 sdhci_free_host(host); 202 sdhci_free_host(host);
203 platform_set_drvdata(pdev, NULL);
204} 203}
205EXPORT_SYMBOL_GPL(sdhci_pltfm_free); 204EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
206 205
diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
index 6a3f702a38a6..98b5145cef7c 100644
--- a/drivers/mmc/host/sdhci-pxav2.c
+++ b/drivers/mmc/host/sdhci-pxav2.c
@@ -253,8 +253,6 @@ static int sdhci_pxav2_remove(struct platform_device *pdev)
253 sdhci_pltfm_free(pdev); 253 sdhci_pltfm_free(pdev);
254 kfree(pxa); 254 kfree(pxa);
255 255
256 platform_set_drvdata(pdev, NULL);
257
258 return 0; 256 return 0;
259} 257}
260 258
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 1ae358e0662d..90ee262def69 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -339,8 +339,6 @@ static int sdhci_pxav3_remove(struct platform_device *pdev)
339 sdhci_pltfm_free(pdev); 339 sdhci_pltfm_free(pdev);
340 kfree(pxa); 340 kfree(pxa);
341 341
342 platform_set_drvdata(pdev, NULL);
343
344 return 0; 342 return 0;
345} 343}
346 344
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index c6f6246a4933..926aaf6acc67 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -745,7 +745,6 @@ static int sdhci_s3c_remove(struct platform_device *pdev)
745 clk_disable_unprepare(sc->clk_io); 745 clk_disable_unprepare(sc->clk_io);
746 746
747 sdhci_free_host(host); 747 sdhci_free_host(host);
748 platform_set_drvdata(pdev, NULL);
749 748
750 return 0; 749 return 0;
751} 750}
diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 7ae5b3ae7bad..2dba9f8d1760 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -258,7 +258,6 @@ static int sdhci_probe(struct platform_device *pdev)
258 return 0; 258 return 0;
259 259
260set_drvdata: 260set_drvdata:
261 platform_set_drvdata(pdev, NULL);
262 sdhci_remove_host(host, 1); 261 sdhci_remove_host(host, 1);
263free_host: 262free_host:
264 sdhci_free_host(host); 263 sdhci_free_host(host);
@@ -278,7 +277,6 @@ static int sdhci_remove(struct platform_device *pdev)
278 int dead = 0; 277 int dead = 0;
279 u32 scratch; 278 u32 scratch;
280 279
281 platform_set_drvdata(pdev, NULL);
282 scratch = readl(host->ioaddr + SDHCI_INT_STATUS); 280 scratch = readl(host->ioaddr + SDHCI_INT_STATUS);
283 if (scratch == (u32)-1) 281 if (scratch == (u32)-1)
284 dead = 1; 282 dead = 1;
diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index ba76a532ae30..117a1f774720 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1501,8 +1501,6 @@ static int sh_mmcif_remove(struct platform_device *pdev)
1501 if (irq[1] >= 0) 1501 if (irq[1] >= 0)
1502 free_irq(irq[1], host); 1502 free_irq(irq[1], host);
1503 1503
1504 platform_set_drvdata(pdev, NULL);
1505
1506 clk_disable(host->hclk); 1504 clk_disable(host->hclk);
1507 mmc_free_host(host->mmc); 1505 mmc_free_host(host->mmc);
1508 pm_runtime_put_sync(&pdev->dev); 1506 pm_runtime_put_sync(&pdev->dev);
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 139212e79cde..8860d4d2bc22 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -112,8 +112,6 @@ static int tmio_mmc_remove(struct platform_device *pdev)
112 const struct mfd_cell *cell = mfd_get_cell(pdev); 112 const struct mfd_cell *cell = mfd_get_cell(pdev);
113 struct mmc_host *mmc = platform_get_drvdata(pdev); 113 struct mmc_host *mmc = platform_get_drvdata(pdev);
114 114
115 platform_set_drvdata(pdev, NULL);
116
117 if (mmc) { 115 if (mmc) {
118 struct tmio_mmc_host *host = mmc_priv(mmc); 116 struct tmio_mmc_host *host = mmc_priv(mmc);
119 free_irq(platform_get_irq(pdev, 0), host); 117 free_irq(platform_get_irq(pdev, 0), host);
diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c
index 442f5766ffca..34231d5168fc 100644
--- a/drivers/mmc/host/wmt-sdmmc.c
+++ b/drivers/mmc/host/wmt-sdmmc.c
@@ -927,8 +927,6 @@ static int wmt_mci_remove(struct platform_device *pdev)
927 927
928 mmc_free_host(mmc); 928 mmc_free_host(mmc);
929 929
930 platform_set_drvdata(pdev, NULL);
931
932 dev_info(&pdev->dev, "WMT MCI device removed\n"); 930 dev_info(&pdev->dev, "WMT MCI device removed\n");
933 931
934 return 0; 932 return 0;