]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: toshsd: Use devm_mmc_alloc_host() helper
authorBinbin Zhou <zhoubinbin@loongson.cn>
Tue, 3 Jun 2025 12:27:36 +0000 (20:27 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 24 Jun 2025 10:43:23 +0000 (12:43 +0200)
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/23c80160c93c868353d2444100a592e8ba5d2f90.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/toshsd.c

index 497791ffada6d7add353a5b1f961aca65718d535..e5f7f8abafc055200c3055bca9f24d8438092dd2 100644 (file)
@@ -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);
 }