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

mmc: rtsx_usb_sdmmc: use modern PM macros

Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.

This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://lore.kernel.org/r/20250815013413.28641-15-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Jisheng Zhang and committed by
Ulf Hansson
99a44c32 8e8214d9

+2 -5
+2 -5
drivers/mmc/host/rtsx_usb_sdmmc.c
··· 1455 1455 ": Realtek USB SD/MMC module has been removed\n"); 1456 1456 } 1457 1457 1458 - #ifdef CONFIG_PM 1459 1458 static int rtsx_usb_sdmmc_runtime_suspend(struct device *dev) 1460 1459 { 1461 1460 struct rtsx_usb_sdmmc *host = dev_get_drvdata(dev); ··· 1472 1473 mmc_detect_change(host->mmc, 0); 1473 1474 return 0; 1474 1475 } 1475 - #endif 1476 1476 1477 1477 static const struct dev_pm_ops rtsx_usb_sdmmc_dev_pm_ops = { 1478 - SET_RUNTIME_PM_OPS(rtsx_usb_sdmmc_runtime_suspend, 1479 - rtsx_usb_sdmmc_runtime_resume, NULL) 1478 + RUNTIME_PM_OPS(rtsx_usb_sdmmc_runtime_suspend, rtsx_usb_sdmmc_runtime_resume, NULL) 1480 1479 }; 1481 1480 1482 1481 static const struct platform_device_id rtsx_usb_sdmmc_ids[] = { ··· 1493 1496 .driver = { 1494 1497 .name = "rtsx_usb_sdmmc", 1495 1498 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 1496 - .pm = &rtsx_usb_sdmmc_dev_pm_ops, 1499 + .pm = pm_ptr(&rtsx_usb_sdmmc_dev_pm_ops), 1497 1500 }, 1498 1501 }; 1499 1502 module_platform_driver(rtsx_usb_sdmmc_driver);