firewire: ohci: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
PATCH 1/1 firewire: ohci: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
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.
--- drivers/firewire/ohci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/firewire/ohci.c +4 -4
@@ -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 )
Signature · 1 line
2.53.0
Takashi Sakamoto
maintainerHi,
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.
Quoted 53 lines · Triet Hoang
Convert the deprecated
SIMPLE_DEV_PM_OPS
toDEFINE_SIMPLE_DEV_PM_OPSandpm_sleep_ptr().This lets us drop the
__maybe_unusedannotations from the suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Triet Hoang <[email protected]>--- drivers/firewire/ohci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/firewire/ohci.c +4
-4@@ -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 )Signature · 1 line
2.53.0
Thanks
Takashi Sakamoto
Hi,
Quoted 11 lines · Triet Hoang
Convert the deprecated
SIMPLE_DEV_PM_OPS
toDEFINE_SIMPLE_DEV_PM_OPSandpm_sleep_ptr().This lets us drop the
__maybe_unusedannotations from the suspend and resume callbacks, and reduces kernel size in caseCONFIG_PMorCONFIG_PM_SLEEPis disabled.Signed-off-by Triet Hoang <[email protected]>--- drivers/firewire/ohci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Applied to for-next branch.
Thanks
Takashi Sakamoto