.enable = ptp_pch_enable,
};
-
-#ifdef CONFIG_PM
-static s32 pch_suspend(struct pci_dev *pdev, pm_message_t state)
-{
- pci_disable_device(pdev);
- pci_enable_wake(pdev, PCI_D3hot, 0);
-
- if (pci_save_state(pdev) != 0) {
- dev_err(&pdev->dev, "could not save PCI config state\n");
- return -ENOMEM;
- }
- pci_set_power_state(pdev, pci_choose_state(pdev, state));
-
- return 0;
-}
-
-static s32 pch_resume(struct pci_dev *pdev)
-{
- s32 ret;
-
- pci_set_power_state(pdev, PCI_D0);
- pci_restore_state(pdev);
- ret = pci_enable_device(pdev);
- if (ret) {
- dev_err(&pdev->dev, "pci_enable_device failed\n");
- return ret;
- }
- pci_enable_wake(pdev, PCI_D3hot, 0);
- return 0;
-}
-#else
#define pch_suspend NULL
#define pch_resume NULL
-#endif
static void pch_remove(struct pci_dev *pdev)
{
{0}
};
+static SIMPLE_DEV_PM_OPS(pch_pm_ops, pch_suspend, pch_resume);
+
static struct pci_driver pch_driver = {
.name = KBUILD_MODNAME,
.id_table = pch_ieee1588_pcidev_id,
.probe = pch_probe,
.remove = pch_remove,
- .suspend = pch_suspend,
- .resume = pch_resume,
+ .driver.pm = &pch_pm_ops,
};
static void __exit ptp_pch_exit(void)