mtip32xx: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
PATCH 1/1 mtip32xx: 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 its suspend and resume callbacks, and reduces kernel size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.
Fixes cd97b7e0d780 ("mtip32xx: convert to generic power management")
Signed-off-by Triet Hoang <[email protected]>
--- drivers/block/mtip32xx/mtip32xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/block/mtip32xx/mtip32xx.c +4 -4
@@ -3937,7 +3937,7 @@ static void mtip_pci_remove(struct pci_dev *pdev)* 0 Success * <0 Error */ -static int __maybe_unused mtip_pci_suspend (struct device *dev) +static int mtip_pci_suspend (struct device *dev) {int rv =0 ;struct driver_data *dd =dev_get_drvdata (dev);
@@ -3959,7 +3959,7 @@ static int __maybe_unused mtip_pci_suspend(struct device *dev)* 0 Success * <0 Error */ -static int __maybe_unused mtip_pci_resume (struct device *dev) +static int mtip_pci_resume (struct device *dev) {int rv =0 ;struct driver_data *dd =dev_get_drvdata (dev);
@@ -4002,7 +4002,7 @@ static const struct pci_device_id mtip_pci_tbl[] = { { 0 } }; -static SIMPLE_DEV_PM_OPS(mtip_pci_pm_ops, mtip_pci_suspend, mtip_pci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mtip_pci_pm_ops, mtip_pci_suspend, mtip_pci_resume);/* Structure that describes the PCI driver functions. */ static struct pci_driver mtip_pci_driver = {
@@ -4010,7 +4010,7 @@ static struct pci_driver mtip_pci_driver = { .id_table = mtip_pci_tbl, .probe = mtip_pci_probe, .remove = mtip_pci_remove, - .driver.pm = &mtip_pci_pm_ops, + .driver.pm = pm_sleep_ptr(&mtip_pci_pm_ops), .shutdown = mtip_pci_shutdown, };
Signature · 1 line
2.53.0