Merge tag 'folio-5.18d' of git://git.infradead.org/users/willy/pagecache
[linux-2.6-microblaze.git] / drivers / virtio / virtio.c
index 22f15f4..75c8d56 100644 (file)
@@ -526,8 +526,9 @@ int virtio_device_restore(struct virtio_device *dev)
                        goto err;
        }
 
-       /* Finally, tell the device we're all set */
-       virtio_add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK);
+       /* If restore didn't do it, mark device DRIVER_OK ourselves. */
+       if (!(dev->config->get_status(dev) & VIRTIO_CONFIG_S_DRIVER_OK))
+               virtio_device_ready(dev);
 
        virtio_config_enable(dev);