mmc: sdhci: disable the clock in sdhci_pltfm_unregister()
So we can avoid to sprinkle the clk_disable_unprepare() in many drivers. Signed-off-by: Kevin Hao <haokexin@gmail.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Родитель
2290fcb341
Коммит
83eacdfa25
|
@ -325,17 +325,7 @@ err_pltfm_free:
|
|||
|
||||
static int sdhci_bcm_kona_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_host *host = platform_get_drvdata(pdev);
|
||||
struct sdhci_pltfm_host *pltfm_priv = sdhci_priv(host);
|
||||
int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
|
||||
|
||||
sdhci_remove_host(host, dead);
|
||||
|
||||
clk_disable_unprepare(pltfm_priv->clk);
|
||||
|
||||
sdhci_pltfm_free(pdev);
|
||||
|
||||
return 0;
|
||||
return sdhci_pltfm_unregister(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver sdhci_bcm_kona_driver = {
|
||||
|
|
|
@ -110,13 +110,7 @@ err_sdhci_add:
|
|||
|
||||
static int sdhci_dove_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_host *host = platform_get_drvdata(pdev);
|
||||
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
|
||||
clk_disable_unprepare(pltfm_host->clk);
|
||||
sdhci_pltfm_unregister(pdev);
|
||||
|
||||
return 0;
|
||||
return sdhci_pltfm_unregister(pdev);
|
||||
}
|
||||
|
||||
static const struct of_device_id sdhci_dove_of_match_table[] = {
|
||||
|
|
|
@ -195,7 +195,6 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
|
|||
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
struct sdhci_arasan_data *sdhci_arasan = pltfm_host->priv;
|
||||
|
||||
clk_disable_unprepare(pltfm_host->clk);
|
||||
clk_disable_unprepare(sdhci_arasan->clk_ahb);
|
||||
|
||||
return sdhci_pltfm_unregister(pdev);
|
||||
|
|
|
@ -225,9 +225,11 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_register);
|
|||
int sdhci_pltfm_unregister(struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_host *host = platform_get_drvdata(pdev);
|
||||
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
|
||||
|
||||
sdhci_remove_host(host, dead);
|
||||
clk_disable_unprepare(pltfm_host->clk);
|
||||
sdhci_pltfm_free(pdev);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -196,11 +196,8 @@ err_clk_prepare:
|
|||
static int sdhci_sirf_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_host *host = platform_get_drvdata(pdev);
|
||||
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
|
||||
clk_disable_unprepare(pltfm_host->clk);
|
||||
sdhci_pltfm_unregister(pdev);
|
||||
return 0;
|
||||
return sdhci_pltfm_unregister(pdev);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
|
|
@ -115,11 +115,6 @@ err_of:
|
|||
|
||||
static int sdhci_st_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_host *host = platform_get_drvdata(pdev);
|
||||
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
|
||||
clk_disable_unprepare(pltfm_host->clk);
|
||||
|
||||
return sdhci_pltfm_unregister(pdev);
|
||||
}
|
||||
|
||||
|
|
|
@ -323,17 +323,7 @@ err_alloc_tegra_host:
|
|||
|
||||
static int sdhci_tegra_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sdhci_host *host = platform_get_drvdata(pdev);
|
||||
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
|
||||
int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
|
||||
|
||||
sdhci_remove_host(host, dead);
|
||||
|
||||
clk_disable_unprepare(pltfm_host->clk);
|
||||
|
||||
sdhci_pltfm_free(pdev);
|
||||
|
||||
return 0;
|
||||
return sdhci_pltfm_unregister(pdev);
|
||||
}
|
||||
|
||||
static struct platform_driver sdhci_tegra_driver = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче