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

index d229c2b83ea99ef4649e875f92355b6a2d831244..9c5d695d04b136fc5b6a63b37cf22512908655ab 100644 (file)
@@ -1334,7 +1334,7 @@ static int rtsx_usb_sdmmc_drv_probe(struct platform_device *pdev)
 
        dev_dbg(&(pdev->dev), ": Realtek USB SD/MMC controller found\n");
 
-       mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
+       mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host));
        if (!mmc)
                return -ENOMEM;
 
@@ -1368,7 +1368,6 @@ static int rtsx_usb_sdmmc_drv_probe(struct platform_device *pdev)
 #ifdef RTSX_USB_USE_LEDS_CLASS
                led_classdev_unregister(&host->led);
 #endif
-               mmc_free_host(mmc);
                pm_runtime_disable(&pdev->dev);
                return ret;
        }
@@ -1406,7 +1405,6 @@ static void rtsx_usb_sdmmc_drv_remove(struct platform_device *pdev)
        led_classdev_unregister(&host->led);
 #endif
 
-       mmc_free_host(mmc);
        pm_runtime_disable(&pdev->dev);
        platform_set_drvdata(pdev, NULL);