* [PATCH] firewire: ohci: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20 8:30 Triet Hoang
0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-20 8:30 UTC (permalink / raw)
To: o-takashi; +Cc: linux1394-devel, linux-kernel, Triet Hoang
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations from the suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/firewire/ohci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 46dd53ecedc7..b7df280bec51 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -3761,7 +3761,7 @@ static void pci_remove(struct pci_dev *dev)
dev_notice(&dev->dev, "removing fw-ohci device\n");
}
-static int __maybe_unused pci_suspend(struct device *dev)
+static int pci_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct fw_ohci *ohci = pci_get_drvdata(pdev);
@@ -3773,7 +3773,7 @@ static int __maybe_unused pci_suspend(struct device *dev)
}
-static int __maybe_unused pci_resume(struct device *dev)
+static int pci_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct fw_ohci *ohci = pci_get_drvdata(pdev);
@@ -3804,14 +3804,14 @@ static const struct pci_device_id pci_table[] = {
MODULE_DEVICE_TABLE(pci, pci_table);
-static SIMPLE_DEV_PM_OPS(pci_pm_ops, pci_suspend, pci_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pci_pm_ops, pci_suspend, pci_resume);
static struct pci_driver fw_ohci_pci_driver = {
.name = ohci_driver_name,
.id_table = pci_table,
.probe = pci_probe,
.remove = pci_remove,
- .driver.pm = &pci_pm_ops,
+ .driver.pm = pm_sleep_ptr(&pci_pm_ops),
};
static int __init fw_ohci_init(void)
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-20 8:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 8:30 [PATCH] firewire: ohci: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox