]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: sdhci: Use devm_mmc_alloc_host() helper
authorBinbin Zhou <zhoubinbin@loongson.cn>
Sat, 7 Jun 2025 07:33:34 +0000 (15:33 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Jun 2025 10:43:24 +0000 (12:43 +0200)
Use new function devm_mmc_alloc_host() to simplify the code.

Although sdhci_free_host() is no longer needed, to avoid drivers that still
use this function from failing to compile, sdhci_free_host() is temporarily
set to empty. Finally, it will be removed when there are no more callers.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/dcfce3ddf980563c590f82c1b4e8840c29497887.1749127796.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index d171c88770271b01afdf804f457c94b904af32a7..fcda2d17c4a4be20533b2825236a8204b4729d2d 100644 (file)
@@ -4072,7 +4072,7 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev,
 
        WARN_ON(dev == NULL);
 
-       mmc = mmc_alloc_host(sizeof(struct sdhci_host) + priv_size, dev);
+       mmc = devm_mmc_alloc_host(dev, sizeof(struct sdhci_host) + priv_size);
        if (!mmc)
                return ERR_PTR(-ENOMEM);
 
@@ -4998,7 +4998,6 @@ EXPORT_SYMBOL_GPL(sdhci_remove_host);
 
 void sdhci_free_host(struct sdhci_host *host)
 {
-       mmc_free_host(host->mmc);
 }
 
 EXPORT_SYMBOL_GPL(sdhci_free_host);