aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorRobert Love <robert.w.love@intel.com>2009-02-27 13:56:06 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-10 10:06:17 -0400
commit03ec862dff57ca3d1fcb439b99aadc45bc5c2f28 (patch)
treeda35accd2d35568a041d0efa77deb306a206c962 /drivers/scsi
parenta468f328ad83f14556e5961ef1de80b32b428d32 (diff)
[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: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/fcoe/fc_transport_fcoe.c3
-rw-r--r--drivers/scsi/fcoe/fcoe_sw.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/fcoe/fc_transport_fcoe.c b/drivers/scsi/fcoe/fc_transport_fcoe.c
index 847453a70c62..8862758006c0 100644
--- a/drivers/scsi/fcoe/fc_transport_fcoe.c
+++ b/drivers/scsi/fcoe/fc_transport_fcoe.c
@@ -258,9 +258,6 @@ int fcoe_transport_register(struct fcoe_transport *t)
258 list_add_tail(&t->list, &fcoe_transports); 258 list_add_tail(&t->list, &fcoe_transports);
259 mutex_unlock(&fcoe_transports_lock); 259 mutex_unlock(&fcoe_transports_lock);
260 260
261 mutex_init(&t->devlock);
262 INIT_LIST_HEAD(&t->devlist);
263
264 printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name); 261 printk(KERN_DEBUG "fcoe_transport_register:%s\n", t->name);
265 262
266 return 0; 263 return 0;
diff --git a/drivers/scsi/fcoe/fcoe_sw.c b/drivers/scsi/fcoe/fcoe_sw.c
index f667dce1bbba..37d359db1648 100644
--- a/drivers/scsi/fcoe/fcoe_sw.c
+++ b/drivers/scsi/fcoe/fcoe_sw.c
@@ -467,10 +467,15 @@ int __init fcoe_sw_init(void)
467 /* attach to scsi transport */ 467 /* attach to scsi transport */
468 scsi_transport_fcoe_sw = 468 scsi_transport_fcoe_sw =
469 fc_attach_transport(&fcoe_sw_transport_function); 469 fc_attach_transport(&fcoe_sw_transport_function);
470
470 if (!scsi_transport_fcoe_sw) { 471 if (!scsi_transport_fcoe_sw) {
471 printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n"); 472 printk(KERN_ERR "fcoe_sw_init:fc_attach_transport() failed\n");
472 return -ENODEV; 473 return -ENODEV;
473 } 474 }
475
476 mutex_init(&fcoe_sw_transport.devlock);
477 INIT_LIST_HEAD(&fcoe_sw_transport.devlist);
478
474 /* register sw transport */ 479 /* register sw transport */
475 fcoe_transport_register(&fcoe_sw_transport); 480 fcoe_transport_register(&fcoe_sw_transport);
476 return 0; 481 return 0;