Commit 89107000 authored by Aaron Lu's avatar Aaron Lu Committed by Rusty Russell

virtio: pm: use CONFIG_PM_SLEEP instead of CONFIG_PM

The freeze and restore functions defined in virtio drivers are used
for suspend and hibernate, so CONFIG_PM_SLEEP is more appropriate than
CONFIG_PM. This patch replace all CONFIG_PM with CONFIG_PM_SLEEP for
virtio drivers that implement freeze and restore callbacks.
Signed-off-by: default avatarAaron Lu <aaron.lu@intel.com>
Reviewed-by: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent d8524ae9
...@@ -899,7 +899,7 @@ static void virtblk_remove(struct virtio_device *vdev) ...@@ -899,7 +899,7 @@ static void virtblk_remove(struct virtio_device *vdev)
ida_simple_remove(&vd_index_ida, index); ida_simple_remove(&vd_index_ida, index);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int virtblk_freeze(struct virtio_device *vdev) static int virtblk_freeze(struct virtio_device *vdev)
{ {
struct virtio_blk *vblk = vdev->priv; struct virtio_blk *vblk = vdev->priv;
...@@ -959,7 +959,7 @@ static struct virtio_driver virtio_blk = { ...@@ -959,7 +959,7 @@ static struct virtio_driver virtio_blk = {
.probe = virtblk_probe, .probe = virtblk_probe,
.remove = virtblk_remove, .remove = virtblk_remove,
.config_changed = virtblk_config_changed, .config_changed = virtblk_config_changed,
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
.freeze = virtblk_freeze, .freeze = virtblk_freeze,
.restore = virtblk_restore, .restore = virtblk_restore,
#endif #endif
......
...@@ -133,7 +133,7 @@ static void virtrng_remove(struct virtio_device *vdev) ...@@ -133,7 +133,7 @@ static void virtrng_remove(struct virtio_device *vdev)
remove_common(vdev); remove_common(vdev);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int virtrng_freeze(struct virtio_device *vdev) static int virtrng_freeze(struct virtio_device *vdev)
{ {
remove_common(vdev); remove_common(vdev);
...@@ -157,7 +157,7 @@ static struct virtio_driver virtio_rng_driver = { ...@@ -157,7 +157,7 @@ static struct virtio_driver virtio_rng_driver = {
.id_table = id_table, .id_table = id_table,
.probe = virtrng_probe, .probe = virtrng_probe,
.remove = virtrng_remove, .remove = virtrng_remove,
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
.freeze = virtrng_freeze, .freeze = virtrng_freeze,
.restore = virtrng_restore, .restore = virtrng_restore,
#endif #endif
......
...@@ -2142,7 +2142,7 @@ static struct virtio_device_id rproc_serial_id_table[] = { ...@@ -2142,7 +2142,7 @@ static struct virtio_device_id rproc_serial_id_table[] = {
static unsigned int rproc_serial_features[] = { static unsigned int rproc_serial_features[] = {
}; };
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int virtcons_freeze(struct virtio_device *vdev) static int virtcons_freeze(struct virtio_device *vdev)
{ {
struct ports_device *portdev; struct ports_device *portdev;
...@@ -2220,7 +2220,7 @@ static struct virtio_driver virtio_console = { ...@@ -2220,7 +2220,7 @@ static struct virtio_driver virtio_console = {
.probe = virtcons_probe, .probe = virtcons_probe,
.remove = virtcons_remove, .remove = virtcons_remove,
.config_changed = config_intr, .config_changed = config_intr,
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
.freeze = virtcons_freeze, .freeze = virtcons_freeze,
.restore = virtcons_restore, .restore = virtcons_restore,
#endif #endif
......
...@@ -1683,7 +1683,7 @@ static void virtnet_remove(struct virtio_device *vdev) ...@@ -1683,7 +1683,7 @@ static void virtnet_remove(struct virtio_device *vdev)
free_netdev(vi->dev); free_netdev(vi->dev);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int virtnet_freeze(struct virtio_device *vdev) static int virtnet_freeze(struct virtio_device *vdev)
{ {
struct virtnet_info *vi = vdev->priv; struct virtnet_info *vi = vdev->priv;
...@@ -1766,7 +1766,7 @@ static struct virtio_driver virtio_net_driver = { ...@@ -1766,7 +1766,7 @@ static struct virtio_driver virtio_net_driver = {
.probe = virtnet_probe, .probe = virtnet_probe,
.remove = virtnet_remove, .remove = virtnet_remove,
.config_changed = virtnet_config_changed, .config_changed = virtnet_config_changed,
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
.freeze = virtnet_freeze, .freeze = virtnet_freeze,
.restore = virtnet_restore, .restore = virtnet_restore,
#endif #endif
......
...@@ -954,7 +954,7 @@ static void virtscsi_remove(struct virtio_device *vdev) ...@@ -954,7 +954,7 @@ static void virtscsi_remove(struct virtio_device *vdev)
scsi_host_put(shost); scsi_host_put(shost);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int virtscsi_freeze(struct virtio_device *vdev) static int virtscsi_freeze(struct virtio_device *vdev)
{ {
virtscsi_remove_vqs(vdev); virtscsi_remove_vqs(vdev);
...@@ -988,7 +988,7 @@ static struct virtio_driver virtio_scsi_driver = { ...@@ -988,7 +988,7 @@ static struct virtio_driver virtio_scsi_driver = {
.id_table = id_table, .id_table = id_table,
.probe = virtscsi_probe, .probe = virtscsi_probe,
.scan = virtscsi_scan, .scan = virtscsi_scan,
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
.freeze = virtscsi_freeze, .freeze = virtscsi_freeze,
.restore = virtscsi_restore, .restore = virtscsi_restore,
#endif #endif
......
...@@ -513,7 +513,7 @@ static void virtballoon_remove(struct virtio_device *vdev) ...@@ -513,7 +513,7 @@ static void virtballoon_remove(struct virtio_device *vdev)
kfree(vb); kfree(vb);
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int virtballoon_freeze(struct virtio_device *vdev) static int virtballoon_freeze(struct virtio_device *vdev)
{ {
struct virtio_balloon *vb = vdev->priv; struct virtio_balloon *vb = vdev->priv;
...@@ -556,7 +556,7 @@ static struct virtio_driver virtio_balloon_driver = { ...@@ -556,7 +556,7 @@ static struct virtio_driver virtio_balloon_driver = {
.probe = virtballoon_probe, .probe = virtballoon_probe,
.remove = virtballoon_remove, .remove = virtballoon_remove,
.config_changed = virtballoon_changed, .config_changed = virtballoon_changed,
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
.freeze = virtballoon_freeze, .freeze = virtballoon_freeze,
.restore = virtballoon_restore, .restore = virtballoon_restore,
#endif #endif
......
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