]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: wbsd: Use devm_mmc_alloc_host() helper
authorBinbin Zhou <zhoubinbin@loongson.cn>
Tue, 3 Jun 2025 12:28:03 +0000 (20:28 +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.

Cc: Pierre Ossman <pierre@ossman.eu>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/1d1d31ac2d6aff5325748693cb1551d7ae21de30.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/wbsd.c

index 2ae787d966de1975315262ea42064a14e2ff871a..c33a0223ce7f453e8bc5dc321cdde6d065bc95bc 100644 (file)
@@ -1190,7 +1190,7 @@ static int wbsd_alloc_mmc(struct device *dev)
        /*
         * Allocate MMC structure.
         */
-       mmc = mmc_alloc_host(sizeof(struct wbsd_host), dev);
+       mmc = devm_mmc_alloc_host(dev, sizeof(*host));
        if (!mmc)
                return -ENOMEM;
 
@@ -1262,8 +1262,6 @@ static void wbsd_free_mmc(struct device *dev)
        BUG_ON(host == NULL);
 
        timer_delete_sync(&host->ignore_timer);
-
-       mmc_free_host(mmc);
 }
 
 /*