aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fnic
diff options
context:
space:
mode:
authorChris Leech <christopher.leech@intel.com>2009-11-03 14:46:08 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:00:56 -0500
commit86221969e20a2f60ce104160dc836a964974673b (patch)
tree83f40bc6490feddd18fe9650cbc3b61f0fb7b2e2 /drivers/scsi/fnic
parent93e6d5ab9969a9200752658677eafd96772302f0 (diff)
[SCSI] libfc: changes to libfc_host_alloc to consolidate initialization with allocation
I'd like to keep basic initialization together with allocation, which means this can't just be a tail-call to scsi_host_alloc. This is needed to create a generic libfc host allocation routine for NPIV VN_Ports, which will share the exchange ID space (through sharing exchange manager structures) with the parent lport. In order to clone the exchange manager list when the lport is allocated, the list head must be initialized earlier. Also, update fnic to use the libfc_host_alloc so that later changes do not break it. (contribution by Joe Eykholt) Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fnic')
-rw-r--r--drivers/scsi/fnic/fnic_main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index fc61f17025ce..018cc427504a 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -424,15 +424,13 @@ static int __devinit fnic_probe(struct pci_dev *pdev,
424 * Allocate SCSI Host and set up association between host, 424 * Allocate SCSI Host and set up association between host,
425 * local port, and fnic 425 * local port, and fnic
426 */ 426 */
427 host = scsi_host_alloc(&fnic_host_template, 427 lp = libfc_host_alloc(&fnic_host_template, sizeof(struct fnic));
428 sizeof(struct fc_lport) + sizeof(struct fnic)); 428 if (!lp) {
429 if (!host) { 429 printk(KERN_ERR PFX "Unable to alloc libfc local port\n");
430 printk(KERN_ERR PFX "Unable to alloc SCSI host\n");
431 err = -ENOMEM; 430 err = -ENOMEM;
432 goto err_out; 431 goto err_out;
433 } 432 }
434 lp = shost_priv(host); 433 host = lp->host;
435 lp->host = host;
436 fnic = lport_priv(lp); 434 fnic = lport_priv(lp);
437 fnic->lport = lp; 435 fnic->lport = lp;
438 436