summaryrefslogtreecommitdiff
path: root/drivers/scsi/esas2r/esas2r_main.c
diff options
context:
space:
mode:
authorVaibhav Gupta <vaibhavgupta40@gmail.com>2020-11-02 22:17:12 +0530
committerMartin K. Petersen <martin.petersen@oracle.com>2020-11-25 23:14:31 -0500
commit5f2d8c365050a53042cb0199caf04b63210c3da0 (patch)
tree62465c26f47af62890756a6e82e16b034546ed1b /drivers/scsi/esas2r/esas2r_main.c
parent996360c141a6097094ca80e50be695b61a63df3c (diff)
downloadlwn-5f2d8c365050a53042cb0199caf04b63210c3da0.tar.gz
lwn-5f2d8c365050a53042cb0199caf04b63210c3da0.zip
scsi: esas2r: Use generic power management
Drivers should do only device-specific jobs. But in general, drivers using legacy PCI PM framework for .suspend()/.resume() have to manage many PCI PM-related tasks themselves which can be done by PCI Core itself. This brings extra load on the driver and it directly calls PCI helper functions to handle them. Switch to the new generic framework by updating function signatures and define a "struct dev_pm_ops" variable to bind PM callbacks. Also, remove unnecessary calls to the PCI Helper functions along with the legacy .suspend & .resume bindings. Link: https://lore.kernel.org/r/20201102164730.324035-12-vaibhavgupta40@gmail.com Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/esas2r/esas2r_main.c')
-rw-r--r--drivers/scsi/esas2r/esas2r_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index 923e6e5ddbf9..a9dd6345f064 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -346,8 +346,7 @@ static struct pci_driver
.id_table = esas2r_pci_table,
.probe = esas2r_probe,
.remove = esas2r_remove,
- .suspend = esas2r_suspend,
- .resume = esas2r_resume,
+ .driver.pm = &esas2r_pm_ops,
};
static int esas2r_probe(struct pci_dev *pcid,