Commit 4c2ad126 authored by Vaibhav Gupta's avatar Vaibhav Gupta Committed by David S. Miller

vxge: use generic power management

With legacy PM, drivers themselves were responsible for managing the
device's power states and takes care of register states.

After upgrading to the generic structure, PCI core will take care of
required tasks and drivers should do only device-specific operations.

Use "struct dev_pm_ops" variable to bind the callbacks.

Compile-tested only.
Signed-off-by: default avatarVaibhav Gupta <vaibhavgupta40@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 64120615
...@@ -3999,12 +3999,11 @@ static void vxge_print_parm(struct vxgedev *vdev, u64 vpath_mask) ...@@ -3999,12 +3999,11 @@ static void vxge_print_parm(struct vxgedev *vdev, u64 vpath_mask)
} }
} }
#ifdef CONFIG_PM
/** /**
* vxge_pm_suspend - vxge power management suspend entry point * vxge_pm_suspend - vxge power management suspend entry point
* *
*/ */
static int vxge_pm_suspend(struct pci_dev *pdev, pm_message_t state) static int __maybe_unused vxge_pm_suspend(struct device *dev_d)
{ {
return -ENOSYS; return -ENOSYS;
} }
...@@ -4012,13 +4011,11 @@ static int vxge_pm_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -4012,13 +4011,11 @@ static int vxge_pm_suspend(struct pci_dev *pdev, pm_message_t state)
* vxge_pm_resume - vxge power management resume entry point * vxge_pm_resume - vxge power management resume entry point
* *
*/ */
static int vxge_pm_resume(struct pci_dev *pdev) static int __maybe_unused vxge_pm_resume(struct device *dev_d)
{ {
return -ENOSYS; return -ENOSYS;
} }
#endif
/** /**
* vxge_io_error_detected - called when PCI error is detected * vxge_io_error_detected - called when PCI error is detected
* @pdev: Pointer to PCI device * @pdev: Pointer to PCI device
...@@ -4796,15 +4793,14 @@ static const struct pci_error_handlers vxge_err_handler = { ...@@ -4796,15 +4793,14 @@ static const struct pci_error_handlers vxge_err_handler = {
.resume = vxge_io_resume, .resume = vxge_io_resume,
}; };
static SIMPLE_DEV_PM_OPS(vxge_pm_ops, vxge_pm_suspend, vxge_pm_resume);
static struct pci_driver vxge_driver = { static struct pci_driver vxge_driver = {
.name = VXGE_DRIVER_NAME, .name = VXGE_DRIVER_NAME,
.id_table = vxge_id_table, .id_table = vxge_id_table,
.probe = vxge_probe, .probe = vxge_probe,
.remove = vxge_remove, .remove = vxge_remove,
#ifdef CONFIG_PM .driver.pm = &vxge_pm_ops,
.suspend = vxge_pm_suspend,
.resume = vxge_pm_resume,
#endif
.err_handler = &vxge_err_handler, .err_handler = &vxge_err_handler,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment