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>
{
struct goldfish_mmc_host *host = platform_get_drvdata(pdev);
- platform_set_drvdata(pdev, NULL);
-
BUG_ON(host == NULL);
mmc_remove_host(host->mmc);
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);
kfree(host->ioarea);
mmc_free_host(host->mmc);
- platform_set_drvdata(pdev, NULL);
}
return 0;
}
{
struct mmc_host *mmc = platform_get_drvdata(pdev);
- platform_set_drvdata(pdev, NULL);
-
if (mmc) {
struct sdh_host *host = mmc_priv(mmc);
{
struct mmc_davinci_host *host = platform_get_drvdata(pdev);
- platform_set_drvdata(pdev, NULL);
if (host) {
mmc_davinci_cpufreq_deregister(host);
{
struct dw_mci *host = platform_get_drvdata(pdev);
- platform_set_drvdata(pdev, NULL);
dw_mci_remove(host);
return 0;
}
err_clk_put:
clk_put(host->clk);
err_free_host:
- platform_set_drvdata(pdev, NULL);
mmc_free_host(mmc);
return ret;
clk_put(host->clk);
- platform_set_drvdata(pdev, NULL);
mmc_free_host(host->mmc);
return 0;
clk_disable_unprepare(host->clk);
mmc_free_host(mmc);
- platform_set_drvdata(pdev, NULL);
return 0;
}
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)
mmc_remove_host(mmc);
- platform_set_drvdata(pdev, NULL);
-
if (ssp->dmach)
dma_release_channel(ssp->dmach);
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++)
}
err1:
iounmap(host->base);
- platform_set_drvdata(pdev, NULL);
mmc_free_host(mmc);
err_alloc:
omap_hsmmc_gpio_free(pdata);
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;
}
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);
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");
return 0;
err_free:
- platform_set_drvdata(pdev, NULL);
sdhci_free_host(c->host);
return err;
}
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;
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);
sdhci_pltfm_free(pdev);
kfree(pxa);
- platform_set_drvdata(pdev, NULL);
-
return 0;
}
sdhci_pltfm_free(pdev);
kfree(pxa);
- platform_set_drvdata(pdev, NULL);
-
return 0;
}
clk_disable_unprepare(sc->clk_io);
sdhci_free_host(host);
- platform_set_drvdata(pdev, NULL);
return 0;
}
return 0;
set_drvdata:
- platform_set_drvdata(pdev, NULL);
sdhci_remove_host(host, 1);
free_host:
sdhci_free_host(host);
int dead = 0;
u32 scratch;
- platform_set_drvdata(pdev, NULL);
scratch = readl(host->ioaddr + SDHCI_INT_STATUS);
if (scratch == (u32)-1)
dead = 1;
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);
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);
mmc_free_host(mmc);
- platform_set_drvdata(pdev, NULL);
-
dev_info(&pdev->dev, "WMT MCI device removed\n");
return 0;