xen-platform: Convert to generic power management

Convert xen-platform from the legacy PCI power management callbacks to the
generic operations.  This is one step towards removing support for the
legacy PCI callbacks.

The generic .resume_noirq() operation is called by pci_pm_resume_noirq() at
the same point the legacy PCI .resume_early() callback was, so this patch
should not change the xen-platform behavior.

Link: https://lore.kernel.org/r/20191101204558.210235-5-helgaas@kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: KarimAllah Ahmed <karahmed@amazon.de>
This commit is contained in:
Bjorn Helgaas 2019-11-01 08:20:40 -05:00
parent baef7f8e5e
commit 77b84bb306

View file

@ -74,7 +74,7 @@ static int xen_allocate_irq(struct pci_dev *pdev)
"xen-platform-pci", pdev); "xen-platform-pci", pdev);
} }
static int platform_pci_resume(struct pci_dev *pdev) static int platform_pci_resume(struct device *dev)
{ {
int err; int err;
@ -83,7 +83,7 @@ static int platform_pci_resume(struct pci_dev *pdev)
err = xen_set_callback_via(callback_via); err = xen_set_callback_via(callback_via);
if (err) { if (err) {
dev_err(&pdev->dev, "platform_pci_resume failure!\n"); dev_err(dev, "platform_pci_resume failure!\n");
return err; return err;
} }
return 0; return 0;
@ -168,13 +168,17 @@ static const struct pci_device_id platform_pci_tbl[] = {
{0,} {0,}
}; };
static struct dev_pm_ops platform_pm_ops = {
.resume_noirq = platform_pci_resume,
};
static struct pci_driver platform_driver = { static struct pci_driver platform_driver = {
.name = DRV_NAME, .name = DRV_NAME,
.probe = platform_pci_probe, .probe = platform_pci_probe,
.id_table = platform_pci_tbl, .id_table = platform_pci_tbl,
#ifdef CONFIG_PM .driver = {
.resume_early = platform_pci_resume, .pm = &platform_pm_ops,
#endif },
}; };
builtin_pci_driver(platform_driver); builtin_pci_driver(platform_driver);