@@ -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 @@ static int cb710_mmc_init(struct platform_device *pdev)
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 = {
Use new function devm_mmc_alloc_host() to simplify the code. Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> --- drivers/mmc/host/cb710-mmc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)