Commit 03ec862d authored by Robert Love's avatar Robert Love Committed by James Bottomley

[SCSI] fcoe: Correct fcoe_transports initialization vs. registration

The registration function shouldn't initialize the mutex or
list head. The fcoe SW transport should initialize itself
before registering.
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent a468f328
...@@ -258,9 +258,6 @@ int fcoe_transport_register(struct fcoe_transport *t) ...@@ -258,9 +258,6 @@ int fcoe_transport_register(struct fcoe_transport *t)
list_add_tail(&t->list, &fcoe_transports); list_add_tail(&t->list, &fcoe_transports);
mutex_unlock(&fcoe_transports_lock); mutex_unlock(&fcoe_transports_lock);
mutex_init(&t->devlock);
INIT_LIST_HEAD(&t->devlist);
printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name); printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name);
return 0; return 0;
......
...@@ -467,10 +467,15 @@ int __init fcoe_sw_init(void) ...@@ -467,10 +467,15 @@ int __init fcoe_sw_init(void)
/* attach to scsi transport */ /* attach to scsi transport */
scsi_transport_fcoe_sw = scsi_transport_fcoe_sw =
fc_attach_transport(&fcoe_sw_transport_function); fc_attach_transport(&fcoe_sw_transport_function);
if (!scsi_transport_fcoe_sw) { if (!scsi_transport_fcoe_sw) {
printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n"); printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n");
return -ENODEV; return -ENODEV;
} }
mutex_init(&fcoe_sw_transport.devlock);
INIT_LIST_HEAD(&fcoe_sw_transport.devlist);
/* register sw transport */ /* register sw transport */
fcoe_transport_register(&fcoe_sw_transport); fcoe_transport_register(&fcoe_sw_transport);
return 0; return 0;
......
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