Commit 0517fdd156c46c23501451158c6b0ff9fb7236d1

Authored by Amit Shah
1 parent f38f8387cb

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>

Showing 1 changed file with 7 additions and 16 deletions Side-by-side Diff

drivers/virtio/virtio_pci.c
... ... @@ -758,33 +758,24 @@
758 758 return ret;
759 759 }
760 760  
761   -static int restore_common(struct device *dev)
  761 +static int virtio_pci_restore(struct device *dev)
762 762 {
763 763 struct pci_dev *pci_dev = to_pci_dev(dev);
764 764 struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
  765 + struct virtio_driver *drv;
765 766 int ret;
766 767  
  768 + drv = container_of(vp_dev->vdev.dev.driver,
  769 + struct virtio_driver, driver);
  770 +
767 771 ret = pci_enable_device(pci_dev);
768 772 if (ret)
769 773 return ret;
  774 +
770 775 pci_set_master(pci_dev);
771 776 vp_finalize_features(&vp_dev->vdev);
772 777  
773   - return ret;
774   -}
775   -
776   -static int virtio_pci_restore(struct device *dev)
777   -{
778   - struct pci_dev *pci_dev = to_pci_dev(dev);
779   - struct virtio_pci_device *vp_dev = pci_get_drvdata(pci_dev);
780   - struct virtio_driver *drv;
781   - int ret;
782   -
783   - drv = container_of(vp_dev->vdev.dev.driver,
784   - struct virtio_driver, driver);
785   -
786   - ret = restore_common(dev);
787   - if (!ret && drv && drv->restore)
  778 + if (drv && drv->restore)
788 779 ret = drv->restore(&vp_dev->vdev);
789 780  
790 781 /* Finally, tell the device we're all set */