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

mmc: rtsx_usb_sdmmc: 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/c7a39ca44f3b07acdfe8cd7e5250c1cbed8e37ca.1748933789.git.zhoubinbin@loongson.cn
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Binbin Zhou and committed by
Ulf Hansson
ee433709 ffcf51d6

+1 -3
+1 -3
drivers/mmc/host/rtsx_usb_sdmmc.c
··· 1334 1334 1335 1335 dev_dbg(&(pdev->dev), ": Realtek USB SD/MMC controller found\n"); 1336 1336 1337 - mmc = mmc_alloc_host(sizeof(*host), &pdev->dev); 1337 + mmc = devm_mmc_alloc_host(&pdev->dev, sizeof(*host)); 1338 1338 if (!mmc) 1339 1339 return -ENOMEM; 1340 1340 ··· 1368 1368 #ifdef RTSX_USB_USE_LEDS_CLASS 1369 1369 led_classdev_unregister(&host->led); 1370 1370 #endif 1371 - mmc_free_host(mmc); 1372 1371 pm_runtime_disable(&pdev->dev); 1373 1372 return ret; 1374 1373 } ··· 1405 1406 led_classdev_unregister(&host->led); 1406 1407 #endif 1407 1408 1408 - mmc_free_host(mmc); 1409 1409 pm_runtime_disable(&pdev->dev); 1410 1410 platform_set_drvdata(pdev, NULL); 1411 1411