Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jingoo Han and committed by
Chris Ball
113a87f8 ad82ab65

-40
-2
drivers/mmc/host/android-goldfish.c
··· 546 546 { 547 547 struct goldfish_mmc_host *host = platform_get_drvdata(pdev); 548 548 549 - platform_set_drvdata(pdev, NULL); 550 - 551 549 BUG_ON(host == NULL); 552 550 553 551 mmc_remove_host(host->mmc);
-2
drivers/mmc/host/atmel-mci.c
··· 2475 2475 struct atmel_mci *host = platform_get_drvdata(pdev); 2476 2476 unsigned int i; 2477 2477 2478 - platform_set_drvdata(pdev, NULL); 2479 - 2480 2478 if (host->buffer) 2481 2479 dma_free_coherent(&pdev->dev, host->buf_size, 2482 2480 host->buffer, host->buf_phys_addr);
-1
drivers/mmc/host/au1xmmc.c
··· 1149 1149 kfree(host->ioarea); 1150 1150 1151 1151 mmc_free_host(host->mmc); 1152 - platform_set_drvdata(pdev, NULL); 1153 1152 } 1154 1153 return 0; 1155 1154 }
-2
drivers/mmc/host/bfin_sdh.c
··· 621 621 { 622 622 struct mmc_host *mmc = platform_get_drvdata(pdev); 623 623 624 - platform_set_drvdata(pdev, NULL); 625 - 626 624 if (mmc) { 627 625 struct sdh_host *host = mmc_priv(mmc); 628 626
-1
drivers/mmc/host/davinci_mmc.c
··· 1406 1406 { 1407 1407 struct mmc_davinci_host *host = platform_get_drvdata(pdev); 1408 1408 1409 - platform_set_drvdata(pdev, NULL); 1410 1409 if (host) { 1411 1410 mmc_davinci_cpufreq_deregister(host); 1412 1411
-1
drivers/mmc/host/dw_mmc-pltfm.c
··· 72 72 { 73 73 struct dw_mci *host = platform_get_drvdata(pdev); 74 74 75 - platform_set_drvdata(pdev, NULL); 76 75 dw_mci_remove(host); 77 76 return 0; 78 77 }
-2
drivers/mmc/host/jz4740_mmc.c
··· 932 932 err_clk_put: 933 933 clk_put(host->clk); 934 934 err_free_host: 935 - platform_set_drvdata(pdev, NULL); 936 935 mmc_free_host(mmc); 937 936 938 937 return ret; ··· 959 960 960 961 clk_put(host->clk); 961 962 962 - platform_set_drvdata(pdev, NULL); 963 963 mmc_free_host(host->mmc); 964 964 965 965 return 0;
-1
drivers/mmc/host/mvsdio.c
··· 827 827 clk_disable_unprepare(host->clk); 828 828 mmc_free_host(mmc); 829 829 830 - platform_set_drvdata(pdev, NULL); 831 830 return 0; 832 831 } 833 832
-2
drivers/mmc/host/mxcmmc.c
··· 1219 1219 struct mmc_host *mmc = platform_get_drvdata(pdev); 1220 1220 struct mxcmci_host *host = mmc_priv(mmc); 1221 1221 1222 - platform_set_drvdata(pdev, NULL); 1223 - 1224 1222 mmc_remove_host(mmc); 1225 1223 1226 1224 if (host->vcc)
-2
drivers/mmc/host/mxs-mmc.c
··· 709 709 710 710 mmc_remove_host(mmc); 711 711 712 - platform_set_drvdata(pdev, NULL); 713 - 714 712 if (ssp->dmach) 715 713 dma_release_channel(ssp->dmach); 716 714
-2
drivers/mmc/host/omap.c
··· 1500 1500 struct mmc_omap_host *host = platform_get_drvdata(pdev); 1501 1501 int i; 1502 1502 1503 - platform_set_drvdata(pdev, NULL); 1504 - 1505 1503 BUG_ON(host == NULL); 1506 1504 1507 1505 for (i = 0; i < host->nr_slots; i++)
-2
drivers/mmc/host/omap_hsmmc.c
··· 2047 2047 } 2048 2048 err1: 2049 2049 iounmap(host->base); 2050 - platform_set_drvdata(pdev, NULL); 2051 2050 mmc_free_host(mmc); 2052 2051 err_alloc: 2053 2052 omap_hsmmc_gpio_free(pdata); ··· 2092 2093 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2093 2094 if (res) 2094 2095 release_mem_region(res->start, resource_size(res)); 2095 - platform_set_drvdata(pdev, NULL); 2096 2096 2097 2097 return 0; 2098 2098 }
-2
drivers/mmc/host/pxamci.c
··· 834 834 struct mmc_host *mmc = platform_get_drvdata(pdev); 835 835 int gpio_cd = -1, gpio_ro = -1, gpio_power = -1; 836 836 837 - platform_set_drvdata(pdev, NULL); 838 - 839 837 if (mmc) { 840 838 struct pxamci_host *host = mmc_priv(mmc); 841 839
-2
drivers/mmc/host/rtsx_pci_sdmmc.c
··· 1316 1316 mmc_remove_host(mmc); 1317 1317 mmc_free_host(mmc); 1318 1318 1319 - platform_set_drvdata(pdev, NULL); 1320 - 1321 1319 dev_dbg(&(pdev->dev), 1322 1320 ": Realtek PCI-E SDMMC controller has been removed\n"); 1323 1321
-2
drivers/mmc/host/sdhci-acpi.c
··· 262 262 return 0; 263 263 264 264 err_free: 265 - platform_set_drvdata(pdev, NULL); 266 265 sdhci_free_host(c->host); 267 266 return err; 268 267 } ··· 280 281 281 282 dead = (sdhci_readl(c->host, SDHCI_INT_STATUS) == ~0); 282 283 sdhci_remove_host(c->host, dead); 283 - platform_set_drvdata(pdev, NULL); 284 284 sdhci_free_host(c->host); 285 285 286 286 return 0;
-1
drivers/mmc/host/sdhci-pltfm.c
··· 200 200 iounmap(host->ioaddr); 201 201 release_mem_region(iomem->start, resource_size(iomem)); 202 202 sdhci_free_host(host); 203 - platform_set_drvdata(pdev, NULL); 204 203 } 205 204 EXPORT_SYMBOL_GPL(sdhci_pltfm_free); 206 205
-2
drivers/mmc/host/sdhci-pxav2.c
··· 253 253 sdhci_pltfm_free(pdev); 254 254 kfree(pxa); 255 255 256 - platform_set_drvdata(pdev, NULL); 257 - 258 256 return 0; 259 257 } 260 258
-2
drivers/mmc/host/sdhci-pxav3.c
··· 339 339 sdhci_pltfm_free(pdev); 340 340 kfree(pxa); 341 341 342 - platform_set_drvdata(pdev, NULL); 343 - 344 342 return 0; 345 343 } 346 344
-1
drivers/mmc/host/sdhci-s3c.c
··· 745 745 clk_disable_unprepare(sc->clk_io); 746 746 747 747 sdhci_free_host(host); 748 - platform_set_drvdata(pdev, NULL); 749 748 750 749 return 0; 751 750 }
-2
drivers/mmc/host/sdhci-spear.c
··· 258 258 return 0; 259 259 260 260 set_drvdata: 261 - platform_set_drvdata(pdev, NULL); 262 261 sdhci_remove_host(host, 1); 263 262 free_host: 264 263 sdhci_free_host(host); ··· 277 278 int dead = 0; 278 279 u32 scratch; 279 280 280 - platform_set_drvdata(pdev, NULL); 281 281 scratch = readl(host->ioaddr + SDHCI_INT_STATUS); 282 282 if (scratch == (u32)-1) 283 283 dead = 1;
-2
drivers/mmc/host/sh_mmcif.c
··· 1501 1501 if (irq[1] >= 0) 1502 1502 free_irq(irq[1], host); 1503 1503 1504 - platform_set_drvdata(pdev, NULL); 1505 - 1506 1504 clk_disable(host->hclk); 1507 1505 mmc_free_host(host->mmc); 1508 1506 pm_runtime_put_sync(&pdev->dev);
-2
drivers/mmc/host/tmio_mmc.c
··· 112 112 const struct mfd_cell *cell = mfd_get_cell(pdev); 113 113 struct mmc_host *mmc = platform_get_drvdata(pdev); 114 114 115 - platform_set_drvdata(pdev, NULL); 116 - 117 115 if (mmc) { 118 116 struct tmio_mmc_host *host = mmc_priv(mmc); 119 117 free_irq(platform_get_irq(pdev, 0), host);
-2
drivers/mmc/host/wmt-sdmmc.c
··· 927 927 928 928 mmc_free_host(mmc); 929 929 930 - platform_set_drvdata(pdev, NULL); 931 - 932 930 dev_info(&pdev->dev, "WMT MCI device removed\n"); 933 931 934 932 return 0;