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

mmc: toshsd: 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-31-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Jisheng Zhang and committed by
Ulf Hansson
a120f217 b2af65ae

+2 -6
+2 -6
drivers/mmc/host/toshsd.c
··· 567 567 pci_write_config_byte(host->pdev, SD_PCICFG_CLKSTOP, 0); 568 568 } 569 569 570 - #ifdef CONFIG_PM_SLEEP 571 570 static int toshsd_pm_suspend(struct device *dev) 572 571 { 573 572 struct pci_dev *pdev = to_pci_dev(dev); ··· 598 599 599 600 return 0; 600 601 } 601 - #endif /* CONFIG_PM_SLEEP */ 602 602 603 603 static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 604 604 { ··· 686 688 pci_disable_device(pdev); 687 689 } 688 690 689 - static const struct dev_pm_ops toshsd_pm_ops = { 690 - SET_SYSTEM_SLEEP_PM_OPS(toshsd_pm_suspend, toshsd_pm_resume) 691 - }; 691 + static DEFINE_SIMPLE_DEV_PM_OPS(toshsd_pm_ops, toshsd_pm_suspend, toshsd_pm_resume); 692 692 693 693 static struct pci_driver toshsd_driver = { 694 694 .name = DRIVER_NAME, 695 695 .id_table = pci_ids, 696 696 .probe = toshsd_probe, 697 697 .remove = toshsd_remove, 698 - .driver.pm = &toshsd_pm_ops, 698 + .driver.pm = pm_sleep_ptr(&toshsd_pm_ops), 699 699 }; 700 700 701 701 module_pci_driver(toshsd_driver);