From: Binbin Zhou Date: Tue, 3 Jun 2025 12:25:33 +0000 (+0800) Subject: mmc: bcm2835: Use devm_mmc_alloc_host() helper X-Git-Tag: v6.17-rc1~165^2~98 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f0aa2f7251916cc4a3bc723b701ff1a5e134aa2;p=thirdparty%2Flinux.git mmc: bcm2835: Use devm_mmc_alloc_host() helper Use new function devm_mmc_alloc_host() to simplify the code. Cc: Florian Fainelli Cc: Ray Jui Cc: Scott Branden Reviewed-by: Huacai Chen Signed-off-by: Binbin Zhou Link: https://lore.kernel.org/r/37a95baec1889f906134deb2dc761a98e950dcd1.1748933789.git.zhoubinbin@loongson.cn Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c index def054ddd2562..3dde5c367ddc8 100644 --- a/drivers/mmc/host/bcm2835.c +++ b/drivers/mmc/host/bcm2835.c @@ -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[] = {