diff options
author | Binbin Zhou <zhoubinbin@loongson.cn> | 2025-06-03 20:25:35 +0800 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2025-06-24 12:43:22 +0200 |
commit | 1f150edbea35a18622a560e236aa1ab8262fbf1c (patch) | |
tree | 939a6b6591b18bfb6567635469ac172a1af3e0af | |
parent | f32b90e6887fc321dd10762d5e4e1d580c20908d (diff) |
mmc: cb710: Use devm_mmc_alloc_host() helper
Use new function devm_mmc_alloc_host() to simplify the code.
Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/4ef97a91053fe8819c651f7968fb56209faa36d8.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/cb710-mmc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c index d741c1f9cf87..8787e7f49e94 100644 --- a/drivers/mmc/host/cb710-mmc.c +++ b/drivers/mmc/host/cb710-mmc.c @@ -692,7 +692,7 @@ static int cb710_mmc_init(struct platform_device *pdev) int err; u32 val; - mmc = mmc_alloc_host(sizeof(*reader), cb710_slot_dev(slot)); + mmc = devm_mmc_alloc_host(cb710_slot_dev(slot), sizeof(*reader)); if (!mmc) return -ENOMEM; @@ -741,7 +741,6 @@ err_free_mmc: dev_dbg(cb710_slot_dev(slot), "mmc_add_host() failed: %d\n", err); cb710_set_irq_handler(slot, NULL); - mmc_free_host(mmc); return err; } @@ -764,8 +763,6 @@ static void cb710_mmc_exit(struct platform_device *pdev) cb710_write_port_16(slot, CB710_MMC_CONFIGB_PORT, 0); cancel_work_sync(&reader->finish_req_bh_work); - - mmc_free_host(mmc); } static struct platform_driver cb710_mmc_driver = { |