Skip to content

Commit f38f838

Browse files
committed
virtio: drop thaw PM operation
The thaw operation was used by the balloon driver, but after the last commit there's no reason to have separate thaw and restore callbacks. Signed-off-by: Amit Shah <[email protected]>
1 parent e47d854 commit f38f838

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

drivers/virtio/virtio_balloon.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,6 @@ static int restore_common(struct virtio_device *vdev)
398398
return 0;
399399
}
400400

401-
static int virtballoon_thaw(struct virtio_device *vdev)
402-
{
403-
return restore_common(vdev);
404-
}
405-
406401
static int virtballoon_restore(struct virtio_device *vdev)
407402
{
408403
return restore_common(vdev);
@@ -426,7 +421,6 @@ static struct virtio_driver virtio_balloon_driver = {
426421
#ifdef CONFIG_PM
427422
.freeze = virtballoon_freeze,
428423
.restore = virtballoon_restore,
429-
.thaw = virtballoon_thaw,
430424
#endif
431425
};
432426

drivers/virtio/virtio_pci.c

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -773,32 +773,6 @@ static int restore_common(struct device *dev)
773773
return ret;
774774
}
775775

776-
static int virtio_pci_thaw(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-
ret = restore_common(dev);
784-
if (ret)
785-
return ret;
786-
787-
drv = container_of(vp_dev->vdev.dev.driver,
788-
struct virtio_driver, driver);
789-
790-
if (drv && drv->thaw)
791-
ret = drv->thaw(&vp_dev->vdev);
792-
else if (drv && drv->restore)
793-
ret = drv->restore(&vp_dev->vdev);
794-
795-
/* Finally, tell the device we're all set */
796-
if (!ret)
797-
vp_set_status(&vp_dev->vdev, vp_dev->saved_status);
798-
799-
return ret;
800-
}
801-
802776
static int virtio_pci_restore(struct device *dev)
803777
{
804778
struct pci_dev *pci_dev = to_pci_dev(dev);
@@ -824,7 +798,7 @@ static const struct dev_pm_ops virtio_pci_pm_ops = {
824798
.suspend = virtio_pci_suspend,
825799
.resume = virtio_pci_resume,
826800
.freeze = virtio_pci_freeze,
827-
.thaw = virtio_pci_thaw,
801+
.thaw = virtio_pci_restore,
828802
.restore = virtio_pci_restore,
829803
.poweroff = virtio_pci_suspend,
830804
};

include/linux/virtio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ struct virtio_driver {
9696
void (*config_changed)(struct virtio_device *dev);
9797
#ifdef CONFIG_PM
9898
int (*freeze)(struct virtio_device *dev);
99-
int (*thaw)(struct virtio_device *dev);
10099
int (*restore)(struct virtio_device *dev);
101100
#endif
102101
};

0 commit comments

Comments
 (0)