]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mmc: bcm2835: Use devm_mmc_alloc_host() helper
authorBinbin Zhou <zhoubinbin@loongson.cn>
Tue, 3 Jun 2025 12:25:33 +0000 (20:25 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Jun 2025 10:43:22 +0000 (12:43 +0200)
Use new function devm_mmc_alloc_host() to simplify the code.

Cc: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Ray Jui <rjui@broadcom.com>
Cc: Scott Branden <sbranden@broadcom.com>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/37a95baec1889f906134deb2dc761a98e950dcd1.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/bcm2835.c

index def054ddd2562819c5db0c343695ed3ee2185cc9..3dde5c367ddc8928801b10f9c93ec1f0c86c5b91 100644 (file)
@@ -1371,7 +1371,7 @@ static int bcm2835_probe(struct platform_device *pdev)
        int ret;
 
        dev_dbg(dev, "%s\n", __func__);
-       mmc = mmc_alloc_host(sizeof(*host), dev);
+       mmc = devm_mmc_alloc_host(dev, sizeof(*host));
        if (!mmc)
                return -ENOMEM;
 
@@ -1450,7 +1450,6 @@ err:
        dev_dbg(dev, "%s -> err %d\n", __func__, ret);
        if (host->dma_chan_rxtx)
                dma_release_channel(host->dma_chan_rxtx);
-       mmc_free_host(mmc);
 
        return ret;
 }
@@ -1473,8 +1472,6 @@ static void bcm2835_remove(struct platform_device *pdev)
 
        if (host->dma_chan_rxtx)
                dma_release_channel(host->dma_chan_rxtx);
-
-       mmc_free_host(mmc);
 }
 
 static const struct of_device_id bcm2835_match[] = {