Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: bcm2835: Use devm_mmc_alloc_host() helper

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>

authored by

Binbin Zhou and committed by
Ulf Hansson
5f0aa2f7 16ca54d0

+1 -4
+1 -4
drivers/mmc/host/bcm2835.c
··· 1371 1371 int ret; 1372 1372 1373 1373 dev_dbg(dev, "%s\n", __func__); 1374 - mmc = mmc_alloc_host(sizeof(*host), dev); 1374 + mmc = devm_mmc_alloc_host(dev, sizeof(*host)); 1375 1375 if (!mmc) 1376 1376 return -ENOMEM; 1377 1377 ··· 1450 1450 dev_dbg(dev, "%s -> err %d\n", __func__, ret); 1451 1451 if (host->dma_chan_rxtx) 1452 1452 dma_release_channel(host->dma_chan_rxtx); 1453 - mmc_free_host(mmc); 1454 1453 1455 1454 return ret; 1456 1455 } ··· 1472 1473 1473 1474 if (host->dma_chan_rxtx) 1474 1475 dma_release_channel(host->dma_chan_rxtx); 1475 - 1476 - mmc_free_host(mmc); 1477 1476 } 1478 1477 1479 1478 static const struct of_device_id bcm2835_match[] = {