linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI/doc: Convert examples to generic power management
@ 2022-06-07 23:29 Bjorn Helgaas
  2022-07-11 23:19 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Helgaas @ 2022-06-07 23:29 UTC (permalink / raw)
  To: linux-pci; +Cc: Vaibhav Gupta, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

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

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 Documentation/PCI/pci-iov-howto.rst | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Documentation/PCI/pci-iov-howto.rst b/Documentation/PCI/pci-iov-howto.rst
index b9fd003206f1..27d35933cea2 100644
--- a/Documentation/PCI/pci-iov-howto.rst
+++ b/Documentation/PCI/pci-iov-howto.rst
@@ -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,
 	};
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI/doc: Convert examples to generic power management
  2022-06-07 23:29 [PATCH] PCI/doc: Convert examples to generic power management Bjorn Helgaas
@ 2022-07-11 23:19 ` Bjorn Helgaas
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2022-07-11 23:19 UTC (permalink / raw)
  To: linux-pci
  Cc: Vaibhav Gupta, Bjorn Helgaas, Jonathan Corbet, linux-doc,
	linux-kernel

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

On Tue, Jun 07, 2022 at 06:29:46PM -0500, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> PCI-specific power management (pci_driver.suspend and pci_driver.resume) is
> deprecated.  Convert sample code to the generic power management framework.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

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

> ---
>  Documentation/PCI/pci-iov-howto.rst | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/PCI/pci-iov-howto.rst b/Documentation/PCI/pci-iov-howto.rst
> index b9fd003206f1..27d35933cea2 100644
> --- a/Documentation/PCI/pci-iov-howto.rst
> +++ b/Documentation/PCI/pci-iov-howto.rst
> @@ -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,
>  	};
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-11 23:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-07 23:29 [PATCH] PCI/doc: Convert examples to generic power management Bjorn Helgaas
2022-07-11 23:19 ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).