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

mmc: sdricoh_cs: Use devm_mmc_alloc_host() helper

Use new function devm_mmc_alloc_host() to simplify the code.

Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/ce16815710f97e853586a0496c315729bd11fb3f.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Binbin Zhou and committed by
Ulf Hansson
2db145df ee433709

+3 -7
+3 -7
drivers/mmc/host/sdricoh_cs.c
··· 403 403 } 404 404 /* allocate privdata */ 405 405 mmc = pcmcia_dev->priv = 406 - mmc_alloc_host(sizeof(struct sdricoh_host), &pcmcia_dev->dev); 406 + devm_mmc_alloc_host(&pcmcia_dev->dev, sizeof(*host)); 407 407 if (!mmc) { 408 - dev_err(dev, "mmc_alloc_host failed\n"); 408 + dev_err(dev, "devm_mmc_alloc_host failed\n"); 409 409 result = -ENOMEM; 410 410 goto unmap_io; 411 411 } ··· 431 431 if (sdricoh_reset(host)) { 432 432 dev_dbg(dev, "could not reset\n"); 433 433 result = -EIO; 434 - goto free_host; 434 + goto unmap_io; 435 435 } 436 436 437 437 result = mmc_add_host(mmc); ··· 440 440 dev_dbg(dev, "mmc host registered\n"); 441 441 return 0; 442 442 } 443 - free_host: 444 - mmc_free_host(mmc); 445 443 unmap_io: 446 444 pci_iounmap(pci_dev, iobase); 447 445 return result; ··· 481 483 mmc_remove_host(mmc); 482 484 pci_iounmap(host->pci_dev, host->iobase); 483 485 pci_dev_put(host->pci_dev); 484 - mmc_free_host(mmc); 485 486 } 486 487 pcmcia_disable_device(link); 487 - 488 488 } 489 489 490 490 #ifdef CONFIG_PM