From c92d54a47ac13c78aa17bb3f57438b9bf38c9e14 Mon Sep 17 00:00:00 2001 From: Binbin Zhou Date: Tue, 3 Jun 2025 20:27:36 +0800 Subject: [PATCH] mmc: toshsd: Use devm_mmc_alloc_host() helper Use new function devm_mmc_alloc_host() to simplify the code. Reviewed-by: Huacai Chen Signed-off-by: Binbin Zhou Link: https://lore.kernel.org/r/23c80160c93c868353d2444100a592e8ba5d2f90.1748933789.git.zhoubinbin@loongson.cn Signed-off-by: Ulf Hansson --- drivers/mmc/host/toshsd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mmc/host/toshsd.c b/drivers/mmc/host/toshsd.c index 497791ffada6d..e5f7f8abafc05 100644 --- a/drivers/mmc/host/toshsd.c +++ b/drivers/mmc/host/toshsd.c @@ -612,7 +612,7 @@ static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (ret) return ret; - mmc = mmc_alloc_host(sizeof(struct toshsd_host), &pdev->dev); + mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host)); if (!mmc) { ret = -ENOMEM; goto err; @@ -669,7 +669,6 @@ unmap: release: pci_release_regions(pdev); free: - mmc_free_host(mmc); pci_set_drvdata(pdev, NULL); err: pci_disable_device(pdev); @@ -685,7 +684,6 @@ static void toshsd_remove(struct pci_dev *pdev) free_irq(pdev->irq, host); pci_iounmap(pdev, host->ioaddr); pci_release_regions(pdev); - mmc_free_host(host->mmc); pci_set_drvdata(pdev, NULL); pci_disable_device(pdev); } -- 2.47.2