]> git.itanic.dy.fi Git - linux-stable/commitdiff
mmc: sdhci-pltfm: Add sdhci_pltfm_remove()
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 11 Aug 2023 13:03:36 +0000 (16:03 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 15 Aug 2023 11:34:51 +0000 (13:34 +0200)
Add sdhci_pltfm_remove() to replace sdhci_pltfm_unregister().
The difference is that sdhci_pltfm_remove() does not do:
clk_disable_unprepare(pltfm_host->clk);
which allows drivers to choose to use devm_clk_get_enabled() or
similar, for pltfm_host->clk.

Once all drivers using sdhci_pltfm_unregister() have been amended to use
sdhci_pltfm_remove() instead, sdhci_pltfm_unregister() will be removed.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230811130351.7038-2-adrian.hunter@intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-pltfm.c
drivers/mmc/host/sdhci-pltfm.h

index 72d07b49b0a38b1991a61e930ca76e2472303933..5a63c881898740705bab2d37688182a3c597de90 100644 (file)
@@ -199,6 +199,16 @@ void sdhci_pltfm_unregister(struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(sdhci_pltfm_unregister);
 
+void sdhci_pltfm_remove(struct platform_device *pdev)
+{
+       struct sdhci_host *host = platform_get_drvdata(pdev);
+       int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
+
+       sdhci_remove_host(host, dead);
+       sdhci_pltfm_free(pdev);
+}
+EXPORT_SYMBOL_GPL(sdhci_pltfm_remove);
+
 #ifdef CONFIG_PM_SLEEP
 int sdhci_pltfm_suspend(struct device *dev)
 {
index 6e6a443dafd94ee3a42a4ad6de5b28f5769dc051..402f4edc6ca513fbd9999a1a12cc8f7b074d18e1 100644 (file)
@@ -103,6 +103,7 @@ extern int sdhci_pltfm_register(struct platform_device *pdev,
                                const struct sdhci_pltfm_data *pdata,
                                size_t priv_size);
 extern void sdhci_pltfm_unregister(struct platform_device *pdev);
+extern void sdhci_pltfm_remove(struct platform_device *pdev);
 
 extern unsigned int sdhci_pltfm_clk_get_max_clock(struct sdhci_host *host);