mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 18:50:53 +07:00
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: Amit Shah <amit.shah@redhat.com>
This commit is contained in:
parent
f38f8387cb
commit
0517fdd156
@ -758,21 +758,6 @@ static int virtio_pci_freeze(struct device *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int restore_common(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||
struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
|
||||
int ret;
|
||||
|
||||
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);
|
||||
@ -783,8 +768,14 @@ static int virtio_pci_restore(struct device *dev)
|
||||
drv = container_of(vp_dev->vdev.dev.driver,
|
||||
struct virtio_driver, driver);
|
||||
|
||||
ret = restore_common(dev);
|
||||
if (!ret && drv && drv->restore)
|
||||
ret = pci_enable_device(pci_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pci_set_master(pci_dev);
|
||||
vp_finalize_features(&vp_dev->vdev);
|
||||
|
||||
if (drv && drv->restore)
|
||||
ret = drv->restore(&vp_dev->vdev);
|
||||
|
||||
/* Finally, tell the device we're all set */
|
||||
|
Loading…
Reference in New Issue
Block a user