Commit 5d8f16d0 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Rusty Russell

virtio_scsi: drop scan callback

Enable VQs early like we do for restore.
This makes it possible to drop the scan callback,
moving scanning into the probe function, and making
code simpler.
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 486d2e63
...@@ -860,17 +860,6 @@ static void virtscsi_init_vq(struct virtio_scsi_vq *virtscsi_vq, ...@@ -860,17 +860,6 @@ static void virtscsi_init_vq(struct virtio_scsi_vq *virtscsi_vq,
virtscsi_vq->vq = vq; virtscsi_vq->vq = vq;
} }
static void virtscsi_scan(struct virtio_device *vdev)
{
struct Scsi_Host *shost = virtio_scsi_host(vdev);
struct virtio_scsi *vscsi = shost_priv(shost);
if (virtio_has_feature(vdev, VIRTIO_SCSI_F_HOTPLUG))
virtscsi_kick_event_all(vscsi);
scsi_scan_host(shost);
}
static void virtscsi_remove_vqs(struct virtio_device *vdev) static void virtscsi_remove_vqs(struct virtio_device *vdev)
{ {
struct Scsi_Host *sh = virtio_scsi_host(vdev); struct Scsi_Host *sh = virtio_scsi_host(vdev);
...@@ -1007,10 +996,13 @@ static int virtscsi_probe(struct virtio_device *vdev) ...@@ -1007,10 +996,13 @@ static int virtscsi_probe(struct virtio_device *vdev)
err = scsi_add_host(shost, &vdev->dev); err = scsi_add_host(shost, &vdev->dev);
if (err) if (err)
goto scsi_add_host_failed; goto scsi_add_host_failed;
/*
* scsi_scan_host() happens in virtscsi_scan() via virtio_driver->scan() virtio_device_ready(vdev);
* after VIRTIO_CONFIG_S_DRIVER_OK has been set..
*/ if (virtio_has_feature(vdev, VIRTIO_SCSI_F_HOTPLUG))
virtscsi_kick_event_all(vscsi);
scsi_scan_host(shost);
return 0; return 0;
scsi_add_host_failed: scsi_add_host_failed:
...@@ -1090,7 +1082,6 @@ static struct virtio_driver virtio_scsi_driver = { ...@@ -1090,7 +1082,6 @@ static struct virtio_driver virtio_scsi_driver = {
.driver.owner = THIS_MODULE, .driver.owner = THIS_MODULE,
.id_table = id_table, .id_table = id_table,
.probe = virtscsi_probe, .probe = virtscsi_probe,
.scan = virtscsi_scan,
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
.freeze = virtscsi_freeze, .freeze = virtscsi_freeze,
.restore = virtscsi_restore, .restore = virtscsi_restore,
......
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