Skip to contentSkip to conversation

PCI/doc: Convert examples to generic power management

PATCH In review Bjorn Helgaas 1 participant 2 messages Jun 8, 2022 – Jul 11, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/doc: Convert examples to generic power management

From: Bjorn Helgaas <[email protected]>

PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. Convert sample code to the generic power management framework.

---
 Documentation/PCI/pci-iov-howto.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/PCI/pci-iov-howto.rst +3 -4
index b9fd003206f1..27d35933cea2 100644
@@ -125,14 +125,14 @@ Following piece of code illustrates the usage of the SR-IOV API.
 		...
 	}
 
-	static int dev_suspend(struct pci_dev *dev, pm_message_t state)
+	static int dev_suspend(struct device *dev)
 	{
 		...
 
 		return 0;
 	}
 
-	static int dev_resume(struct pci_dev *dev)
+	static int dev_resume(struct device *dev)
 	{
 		...
 
@@ -165,8 +165,7 @@ Following piece of code illustrates the usage of the SR-IOV API.
 		.id_table =	dev_id_table,
 		.probe =	dev_probe,
 		.remove =	dev_remove,
-		.suspend =	dev_suspend,
-		.resume =	dev_resume,
+		.driver.pm =	&dev_pm_ops,
 		.shutdown =	dev_shutdown,
 		.sriov_configure = dev_sriov_configure,
 	};
Signature · 1 line
2.25.1
#1 lore raw

[+cc Jonathan, linux-doc, linux-kernel; sorry I missed you earlier]

Quoted 6 lines · Bjorn Helgaas

From: Bjorn Helgaas <[email protected]>

PCI-specific power management (pci_driver.suspend and pci_driver.resume) is deprecated. Convert sample code to the generic power management framework.

I applied this to pci/pm for v5.20. Let me know if you object!

Quoted 38 lines
---
 Documentation/PCI/pci-iov-howto.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/PCI/pci-iov-howto.rst +3 -4
index b9fd003206f1..27d35933cea2 100644
@@ -125,14 +125,14 @@ Following piece of code illustrates the usage of the SR-IOV API.
...
 	}
 
-	static int dev_suspend(struct pci_dev *dev, pm_message_t state)
+	static int dev_suspend(struct device *dev)
 	{
...
 
 		return 0;
 	}
 
-	static int dev_resume(struct pci_dev *dev)
+	static int dev_resume(struct device *dev)
 	{
...
@@ -165,8 +165,7 @@ Following piece of code illustrates the usage of the SR-IOV API.
 		.id_table =	dev_id_table,
 		.probe =	dev_probe,
 		.remove =	dev_remove,
-		.suspend =	dev_suspend,
-		.resume =	dev_resume,
+		.driver.pm =	&dev_pm_ops,
 		.shutdown =	dev_shutdown,
 		.sriov_configure = dev_sriov_configure,
 	};
Signature · 1 line
2.25.1