mmc: sdhci-pltfm: Add sdhci_pltfm_remove()

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>
This commit is contained in:
Adrian Hunter 2023-08-11 16:03:36 +03:00 committed by Ulf Hansson
parent 1930c059b2
commit 32261f9b72
2 changed files with 11 additions and 0 deletions

View 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)
{

View 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);