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

mmc: via-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 __maybe_unused.

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

authored by

Jisheng Zhang and committed by
Ulf Hansson
9ae88dc9 1d955e4a

+5 -5
+5 -5
drivers/mmc/host/via-sdmmc.c
··· 1218 1218 pci_name(pcidev), (int)pcidev->vendor, (int)pcidev->device); 1219 1219 } 1220 1220 1221 - static void __maybe_unused via_init_sdc_pm(struct via_crdr_mmc_host *host) 1221 + static void via_init_sdc_pm(struct via_crdr_mmc_host *host) 1222 1222 { 1223 1223 struct sdhcreg *pm_sdhcreg; 1224 1224 void __iomem *addrbase; ··· 1252 1252 via_print_sdchc(host); 1253 1253 } 1254 1254 1255 - static int __maybe_unused via_sd_suspend(struct device *dev) 1255 + static int via_sd_suspend(struct device *dev) 1256 1256 { 1257 1257 struct via_crdr_mmc_host *host; 1258 1258 unsigned long flags; ··· 1269 1269 return 0; 1270 1270 } 1271 1271 1272 - static int __maybe_unused via_sd_resume(struct device *dev) 1272 + static int via_sd_resume(struct device *dev) 1273 1273 { 1274 1274 struct via_crdr_mmc_host *sdhost; 1275 1275 u8 gatt; ··· 1295 1295 return 0; 1296 1296 } 1297 1297 1298 - static SIMPLE_DEV_PM_OPS(via_sd_pm_ops, via_sd_suspend, via_sd_resume); 1298 + static DEFINE_SIMPLE_DEV_PM_OPS(via_sd_pm_ops, via_sd_suspend, via_sd_resume); 1299 1299 1300 1300 static struct pci_driver via_sd_driver = { 1301 1301 .name = DRV_NAME, 1302 1302 .id_table = via_ids, 1303 1303 .probe = via_sd_probe, 1304 1304 .remove = via_sd_remove, 1305 - .driver.pm = &via_sd_pm_ops, 1305 + .driver.pm = pm_sleep_ptr(&via_sd_pm_ops), 1306 1306 }; 1307 1307 1308 1308 module_pci_driver(via_sd_driver);