Commit 0517fdd1 authored by Amit Shah's avatar Amit Shah

virtio-pci: drop restore_common()

restore_common() was shared between restore and thaw callbacks.  With
thaw gone, we don't need restore_common() anymore.
Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
parent f38f8387
...@@ -758,33 +758,24 @@ static int virtio_pci_freeze(struct device *dev) ...@@ -758,33 +758,24 @@ static int virtio_pci_freeze(struct device *dev)
return ret; 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 pci_dev *pci_dev = to_pci_dev(dev);
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev); struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
struct virtio_driver *drv;
int ret; int ret;
drv = container_of(vp_dev->vdev.dev.driver,
struct virtio_driver, driver);
ret = pci_enable_device(pci_dev); ret = pci_enable_device(pci_dev);
if (ret) if (ret)
return ret; return ret;
pci_set_master(pci_dev); pci_set_master(pci_dev);
vp_finalize_features(&vp_dev->vdev); vp_finalize_features(&vp_dev->vdev);
return ret; if (drv && drv->restore)
}
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)
ret = drv->restore(&vp_dev->vdev); ret = drv->restore(&vp_dev->vdev);
/* Finally, tell the device we're all set */ /* Finally, tell the device we're all set */
......
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