Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 284244
b: refs/heads/master
c: d077536
h: refs/heads/master
v: v3
  • Loading branch information
Amit Shah authored and Rusty Russell committed Jan 12, 2012
1 parent 4bf02df commit b700f08
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4678d6f970c2f7c0cbfefc0cc666432d153b321b
refs/heads/master: d077536386595309060dda57e7b7474c501a589b
16 changes: 12 additions & 4 deletions trunk/drivers/virtio/virtio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,19 +716,28 @@ static void __devexit virtio_pci_remove(struct pci_dev *pci_dev)
}

#ifdef CONFIG_PM
static int virtio_pci_suspend(struct pci_dev *pci_dev, pm_message_t state)
static int virtio_pci_suspend(struct device *dev)
{
struct pci_dev *pci_dev = to_pci_dev(dev);

pci_save_state(pci_dev);
pci_set_power_state(pci_dev, PCI_D3hot);
return 0;
}

static int virtio_pci_resume(struct pci_dev *pci_dev)
static int virtio_pci_resume(struct device *dev)
{
struct pci_dev *pci_dev = to_pci_dev(dev);

pci_restore_state(pci_dev);
pci_set_power_state(pci_dev, PCI_D0);
return 0;
}

static const struct dev_pm_ops virtio_pci_pm_ops = {
.suspend = virtio_pci_suspend,
.resume = virtio_pci_resume,
};
#endif

static struct pci_driver virtio_pci_driver = {
Expand All @@ -737,8 +746,7 @@ static struct pci_driver virtio_pci_driver = {
.probe = virtio_pci_probe,
.remove = __devexit_p(virtio_pci_remove),
#ifdef CONFIG_PM
.suspend = virtio_pci_suspend,
.resume = virtio_pci_resume,
.driver.pm = &virtio_pci_pm_ops,
#endif
};

Expand Down

0 comments on commit b700f08

Please sign in to comment.