]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: rtsx_pci: Use devm_mmc_alloc_host() helper
authorBinbin Zhou <zhoubinbin@loongson.cn>
Tue, 3 Jun 2025 12:27:18 +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/f18424d5bf8b3055de7d8bcf3918868707086e85.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/rtsx_pci_sdmmc.c

index 0c6eb60a95fdbd8a565efc05d2869c28e8ab2b06..dc2587ff8519f8816815524104ae7200952a9d3c 100644 (file)
@@ -1498,7 +1498,7 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
 
        dev_dbg(&(pdev->dev), ": Realtek PCI-E SDMMC controller found\n");
 
-       mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
+       mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host));
        if (!mmc)
                return -ENOMEM;
 
@@ -1529,7 +1529,6 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)
        if (ret) {
                pm_runtime_dont_use_autosuspend(&pdev->dev);
                pm_runtime_disable(&pdev->dev);
-               mmc_free_host(mmc);
                return ret;
        }
 
@@ -1572,8 +1571,6 @@ static void rtsx_pci_sdmmc_drv_remove(struct platform_device *pdev)
        pm_runtime_dont_use_autosuspend(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
 
-       mmc_free_host(mmc);
-
        dev_dbg(&(pdev->dev),
                ": Realtek PCI-E SDMMC controller has been removed\n");
 }