diff options
author | Kevin Hao <haokexin@gmail.com> | 2015-02-27 15:47:30 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-03-23 14:13:34 +0100 |
commit | 83eacdfa2529b4ee97fe16a3a3a41d1b03465e13 (patch) | |
tree | 282158f8efb849008b2a68c987af7abf6473b7e9 /drivers/mmc | |
parent | 2290fcb341a07cc22c0f7f7d529c137a78039cdf (diff) | |
download | op-kernel-dev-83eacdfa2529b4ee97fe16a3a3a41d1b03465e13.zip op-kernel-dev-83eacdfa2529b4ee97fe16a3a3a41d1b03465e13.tar.gz |
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci-bcm-kona.c | 12 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-dove.c | 8 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-of-arasan.c | 1 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-pltfm.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-sirf.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-st.c | 5 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-tegra.c | 12 |
7 files changed, 6 insertions, 39 deletions
diff --git a/drivers/mmc/host/sdhci-bcm-kona.c b/drivers/mmc/host/sdhci-bcm-kona.c index 5bc263b..91cba26 100644 --- a/drivers/mmc/host/sdhci-bcm-kona.c +++ b/drivers/mmc/host/sdhci-bcm-kona.c @@ -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 = { diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c index f78440e..2314ff8 100644 --- a/drivers/mmc/host/sdhci-dove.c +++ b/drivers/mmc/host/sdhci-dove.c @@ -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[] = { diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index bcb51e9..129079f 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -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); diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index c5b01d6..74c58d9 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -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; diff --git a/drivers/mmc/host/sdhci-sirf.c b/drivers/mmc/host/sdhci-sirf.c index 0f75aa9..f3c8d8d 100644 --- a/drivers/mmc/host/sdhci-sirf.c +++ b/drivers/mmc/host/sdhci-sirf.c @@ -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 diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c index 882b07e..0019df4 100644 --- a/drivers/mmc/host/sdhci-st.c +++ b/drivers/mmc/host/sdhci-st.c @@ -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); } diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 0643f66..12881e0 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -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 = { |