aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2014-10-14 19:52:33 -0400
committerRusty Russell <rusty@rustcorp.com.au>2014-10-14 19:55:14 -0400
commit5d8f16d08ba42937ae8c4152d218a77671be4b8f (patch)
treec7ce4f6f016a2c8e63817eae8295e529bc0ffdf3
parent486d2e632ca157558a738626c092973f309f3b45 (diff)
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: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r--drivers/scsi/virtio_scsi.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 0227d39f45f0..b83846fc7859 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -860,17 +860,6 @@ static void virtscsi_init_vq(struct virtio_scsi_vq *virtscsi_vq,
860 virtscsi_vq->vq = vq; 860 virtscsi_vq->vq = vq;
861} 861}
862 862
863static void virtscsi_scan(struct virtio_device *vdev)
864{
865 struct Scsi_Host *shost = virtio_scsi_host(vdev);
866 struct virtio_scsi *vscsi = shost_priv(shost);
867
868 if (virtio_has_feature(vdev, VIRTIO_SCSI_F_HOTPLUG))
869 virtscsi_kick_event_all(vscsi);
870
871 scsi_scan_host(shost);
872}
873
874static void virtscsi_remove_vqs(struct virtio_device *vdev) 863static void virtscsi_remove_vqs(struct virtio_device *vdev)
875{ 864{
876 struct Scsi_Host *sh = virtio_scsi_host(vdev); 865 struct Scsi_Host *sh = virtio_scsi_host(vdev);
@@ -1007,10 +996,13 @@ static int virtscsi_probe(struct virtio_device *vdev)
1007 err = scsi_add_host(shost, &vdev->dev); 996 err = scsi_add_host(shost, &vdev->dev);
1008 if (err) 997 if (err)
1009 goto scsi_add_host_failed; 998 goto scsi_add_host_failed;
1010 /* 999
1011 * scsi_scan_host() happens in virtscsi_scan() via virtio_driver->scan() 1000 virtio_device_ready(vdev);
1012 * after VIRTIO_CONFIG_S_DRIVER_OK has been set.. 1001
1013 */ 1002 if (virtio_has_feature(vdev, VIRTIO_SCSI_F_HOTPLUG))
1003 virtscsi_kick_event_all(vscsi);
1004
1005 scsi_scan_host(shost);
1014 return 0; 1006 return 0;
1015 1007
1016scsi_add_host_failed: 1008scsi_add_host_failed:
@@ -1090,7 +1082,6 @@ static struct virtio_driver virtio_scsi_driver = {
1090 .driver.owner = THIS_MODULE, 1082 .driver.owner = THIS_MODULE,
1091 .id_table = id_table, 1083 .id_table = id_table,
1092 .probe = virtscsi_probe, 1084 .probe = virtscsi_probe,
1093 .scan = virtscsi_scan,
1094#ifdef CONFIG_PM_SLEEP 1085#ifdef CONFIG_PM_SLEEP
1095 .freeze = virtscsi_freeze, 1086 .freeze = virtscsi_freeze,
1096 .restore = virtscsi_restore, 1087 .restore = virtscsi_restore,