]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] ibmvstgt: set up scsi_host properly before __scsi_alloc_queue
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Sat, 1 Mar 2008 06:36:34 +0000 (15:36 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 3 Mar 2008 19:19:03 +0000 (13:19 -0600)
Before calling __scsi_alloc_queue, scsi_host->shost_gendev.parent must
be initialized properly.

This patch moves __scsi_alloc_queue after scsi_add_host (like
initiator drivers do).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/ibmvscsi/ibmvstgt.c

index bd62131b97a1d431eef230ab0efd9ed487a7234f..429bf53f4118dd41b0d4cf1d327f97d7811ea8a9 100644 (file)
@@ -838,9 +838,6 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
        if (!shost)
                goto free_vport;
        shost->transportt = ibmvstgt_transport_template;
-       err = scsi_tgt_alloc_queue(shost);
-       if (err)
-               goto put_host;
 
        target = host_to_srp_target(shost);
        target->shost = shost;
@@ -872,6 +869,10 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
        if (err)
                goto destroy_queue;
 
+       err = scsi_tgt_alloc_queue(shost);
+       if (err)
+               goto destroy_queue;
+
        return 0;
 destroy_queue:
        crq_queue_destroy(target);