diff mbox series

PCI: Make use of the helper macro SET_RUNTIME_PM_OPS()

Message ID 20210828085642.559-1-caihuoqing@baidu.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Make use of the helper macro SET_RUNTIME_PM_OPS() | expand

Commit Message

Cai,Huoqing Aug. 28, 2021, 8:56 a.m. UTC
Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
operators ".runtime_suspend/.runtime_resume/.runtime_idle", because
the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
in to make code a little clearer, a little more concise.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/pci/pci-driver.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index a0615395500a..deddd0e28e6c 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1330,6 +1330,7 @@  static int pci_pm_runtime_idle(struct device *dev)
 }
 
 static const struct dev_pm_ops pci_dev_pm_ops = {
+	SET_RUNTIME_PM_OPS(pci_pm_runtime_suspend, pci_pm_runtime_resume, pci_pm_runtime_idle)
 	.prepare = pci_pm_prepare,
 	.complete = pci_pm_complete,
 	.suspend = pci_pm_suspend,
@@ -1347,9 +1348,6 @@  static const struct dev_pm_ops pci_dev_pm_ops = {
 	.thaw_noirq = pci_pm_thaw_noirq,
 	.poweroff_noirq = pci_pm_poweroff_noirq,
 	.restore_noirq = pci_pm_restore_noirq,
-	.runtime_suspend = pci_pm_runtime_suspend,
-	.runtime_resume = pci_pm_runtime_resume,
-	.runtime_idle = pci_pm_runtime_idle,
 };
 
 #define PCI_PM_OPS_PTR	(&pci_dev_pm_ops)