Re: [PATCH] firewire: ohci: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
From: Takashi Sakamoto
Date: Fri Aug 21 2026 - 19:32:11 EST
Hi,
Thanks for the patch, however we are currently in the middle of merge
window, while the change is not for the urgent issue. I'll postpone
applying it until the merge window closes. This means it will go into the
post-v7.3 kernel.
On Thu, Aug 20, 2026 at 03:30:34PM +0700, Triet Hoang wrote:
> 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@xxxxxxxxx>
> ---
> 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
Thanks
Takashi Sakamoto