]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] fcoe: Correct fcoe_transports initialization vs. registration
authorRobert Love <robert.w.love@intel.com>
Fri, 27 Feb 2009 18:56:06 +0000 (10:56 -0800)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Tue, 10 Mar 2009 14:06:17 +0000 (09:06 -0500)
The registration function shouldn't initialize the mutex or
list head. The fcoe SW transport should initialize itself
before registering.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/fcoe/fc_transport_fcoe.c
drivers/scsi/fcoe/fcoe_sw.c

index 847453a70c62414bce85b8648409616bd6b8e2bc..8862758006c034eee976371caba2574dc526d981 100644 (file)
@@ -258,9 +258,6 @@ int fcoe_transport_register(struct fcoe_transport *t)
        list_add_tail(&t->list, &fcoe_transports);
        mutex_unlock(&fcoe_transports_lock);
 
-       mutex_init(&t->devlock);
-       INIT_LIST_HEAD(&t->devlist);
-
        printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name);
 
        return 0;
index f667dce1bbba9bab39c688cec3aa545fe59a64f5..37d359db16480ae39055d038dc428efce02f9c3e 100644 (file)
@@ -467,10 +467,15 @@ int __init fcoe_sw_init(void)
        /* attach to scsi transport */
        scsi_transport_fcoe_sw =
                fc_attach_transport(&fcoe_sw_transport_function);
+
        if (!scsi_transport_fcoe_sw) {
                printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n");
                return -ENODEV;
        }
+
+       mutex_init(&fcoe_sw_transport.devlock);
+       INIT_LIST_HEAD(&fcoe_sw_transport.devlist);
+
        /* register sw transport */
        fcoe_transport_register(&fcoe_sw_transport);
        return 0;