[SCSI] ibmvstgt: move crq_queue_create to the end of initialization
[cascardo/linux.git] / drivers / scsi / ibmvscsi / ibmvstgt.c
index 2e13ec0..e2dd6a4 100644 (file)
@@ -55,7 +55,7 @@
 /* tmp - will replace with SCSI logging stuff */
 #define eprintk(fmt, args...)                                  \
 do {                                                           \
-       printk("%s(%d) " fmt, __FUNCTION__, __LINE__, ##args);  \
+       printk("%s(%d) " fmt, __func__, __LINE__, ##args);      \
 } while (0)
 /* #define dprintk eprintk */
 #define dprintk(fmt, args...)
@@ -864,21 +864,23 @@ static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id)
 
        INIT_WORK(&vport->crq_work, handle_crq);
 
-       err = crq_queue_create(&vport->crq_queue, target);
+       err = scsi_add_host(shost, target->dev);
        if (err)
                goto free_srp_target;
 
-       err = scsi_add_host(shost, target->dev);
+       err = scsi_tgt_alloc_queue(shost);
        if (err)
-               goto destroy_queue;
+               goto remove_host;
 
-       err = scsi_tgt_alloc_queue(shost);
+       err = crq_queue_create(&vport->crq_queue, target);
        if (err)
-               goto destroy_queue;
+               goto free_queue;
 
        return 0;
-destroy_queue:
-       crq_queue_destroy(target);
+free_queue:
+       scsi_tgt_free_queue(shost);
+remove_host:
+       scsi_remove_host(shost);
 free_srp_target:
        srp_target_free(target);
 put_host: