Thread (6 messages) 6 messages, 1 author, 2012-03-29
STALE5196d

[PATCH 3/5] virtio-pci: drop restore_common()

From: Amit Shah <hidden>
Date: 2012-03-29 08:28:09
Subsystem: the rest, virtio core · Maintainers: Linus Torvalds, "Michael S. Tsirkin", Jason Wang

restore_common() was shared between restore and thaw callbacks.  With
thaw gone, we don't need restore_common() anymore.

Signed-off-by: Amit Shah <redacted>
---
 drivers/virtio/virtio_pci.c |   23 +++++++----------------
 1 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c
index a35a402..982d6c9 100644
--- a/drivers/virtio/virtio_pci.c
+++ b/drivers/virtio/virtio_pci.c
@@ -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 */
-- 
1.7.7.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help