aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJisheng Zhang <jszhang@kernel.org>2025-08-15 09:34:05 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2025-08-22 12:14:04 +0200
commita120f2175d0f10e985fd7eb6007119f8ed53e083 (patch)
treeaaa0d413715d410bd7467aabd20d7ef84e4fffd0 /drivers/mmc
parentb2af65aee264a496c766ea595ecdb3f2c610b8b5 (diff)
downloadnet-a120f2175d0f10e985fd7eb6007119f8ed53e083.tar.gz
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/toshsd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mmc/host/toshsd.c b/drivers/mmc/host/toshsd.c
index e5f7f8abafc055..aa5d2511a62b8f 100644
--- a/drivers/mmc/host/toshsd.c
+++ b/drivers/mmc/host/toshsd.c
@@ -567,7 +567,6 @@ static void toshsd_powerdown(struct toshsd_host *host)
pci_write_config_byte(host->pdev, SD_PCICFG_CLKSTOP, 0);
}
-#ifdef CONFIG_PM_SLEEP
static int toshsd_pm_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
@@ -599,7 +598,6 @@ static int toshsd_pm_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
@@ -688,16 +686,14 @@ static void toshsd_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
}
-static const struct dev_pm_ops toshsd_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(toshsd_pm_suspend, toshsd_pm_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(toshsd_pm_ops, toshsd_pm_suspend, toshsd_pm_resume);
static struct pci_driver toshsd_driver = {
.name = DRIVER_NAME,
.id_table = pci_ids,
.probe = toshsd_probe,
.remove = toshsd_remove,
- .driver.pm = &toshsd_pm_ops,
+ .driver.pm = pm_sleep_ptr(&toshsd_pm_ops),
};
module_pci_driver(toshsd_driver);