Skip to content

Commit

Permalink
virtio-pci: drop restore_common()
Browse files Browse the repository at this point in the history
restore_common() was shared between restore and thaw callbacks.  With
thaw gone, we don't need restore_common() anymore.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
  • Loading branch information
Amit Shah committed Mar 31, 2012
1 parent f38f838 commit 0517fdd
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions drivers/virtio/virtio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,33 +758,24 @@ static int virtio_pci_freeze(struct device *dev)
return ret;
}

static int restore_common(struct device *dev)
static int virtio_pci_restore(struct device *dev)
{
struct pci_dev *pci_dev = to_pci_dev(dev);
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
struct virtio_driver *drv;
int ret;

drv = container_of(vp_dev->vdev.dev.driver,
struct virtio_driver, driver);

ret = pci_enable_device(pci_dev);
if (ret)
return ret;

pci_set_master(pci_dev);
vp_finalize_features(&vp_dev->vdev);

return ret;
}

static int virtio_pci_restore(struct device *dev)
{
struct pci_dev *pci_dev = to_pci_dev(dev);
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
struct virtio_driver *drv;
int ret;

drv = container_of(vp_dev->vdev.dev.driver,
struct virtio_driver, driver);

ret = restore_common(dev);
if (!ret && drv && drv->restore)
if (drv && drv->restore)
ret = drv->restore(&vp_dev->vdev);

/* Finally, tell the device we're all set */
Expand Down

0 comments on commit 0517fdd

Please sign in to comment.