diff options
author | Eric Moore <eric.moore@lsi.com> | 2007-09-14 20:49:03 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-12 14:48:46 -0400 |
commit | e80b002bfd38263117da93feb4f67f5cf7d9221b (patch) | |
tree | 169d482e07e69dbe0fb6407f342e625099916b5c /drivers/message/fusion/mptfc.c | |
parent | a69de507aae293e32d22e873f34f25f49b2db3b2 (diff) |
[SCSI] mpt fusion: removing references to hd->ioc
Cleaning up code by accesing the ioc pointer directly instead of via hd->ioc. In the future, most data members of struct MPT_SCSI_HOST will be either deleted or moved to struct MPT_ADAPTER.
Signed-off-by: Eric Moore <Eric.Moore@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptfc.c')
-rw-r--r-- | drivers/message/fusion/mptfc.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index 061702d32888..19438ecc47a6 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -194,12 +194,14 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, | |||
194 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); | 194 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); |
195 | unsigned long flags; | 195 | unsigned long flags; |
196 | int ready; | 196 | int ready; |
197 | MPT_ADAPTER *ioc; | ||
197 | 198 | ||
198 | hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata; | 199 | hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata; |
200 | ioc = hd->ioc; | ||
199 | spin_lock_irqsave(shost->host_lock, flags); | 201 | spin_lock_irqsave(shost->host_lock, flags); |
200 | while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) { | 202 | while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) { |
201 | spin_unlock_irqrestore(shost->host_lock, flags); | 203 | spin_unlock_irqrestore(shost->host_lock, flags); |
202 | dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT | 204 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
203 | "mptfc_block_error_handler.%d: %d:%d, port status is " | 205 | "mptfc_block_error_handler.%d: %d:%d, port status is " |
204 | "DID_IMM_RETRY, deferring %s recovery.\n", | 206 | "DID_IMM_RETRY, deferring %s recovery.\n", |
205 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, | 207 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, |
@@ -211,7 +213,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, | |||
211 | spin_unlock_irqrestore(shost->host_lock, flags); | 213 | spin_unlock_irqrestore(shost->host_lock, flags); |
212 | 214 | ||
213 | if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) { | 215 | if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) { |
214 | dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT | 216 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
215 | "%s.%d: %d:%d, failing recovery, " | 217 | "%s.%d: %d:%d, failing recovery, " |
216 | "port state %d, vdevice %p.\n", caller, | 218 | "port state %d, vdevice %p.\n", caller, |
217 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, | 219 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, |
@@ -220,7 +222,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, | |||
220 | SCpnt->device->hostdata)); | 222 | SCpnt->device->hostdata)); |
221 | return FAILED; | 223 | return FAILED; |
222 | } | 224 | } |
223 | dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT | 225 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
224 | "%s.%d: %d:%d, executing recovery.\n", caller, | 226 | "%s.%d: %d:%d, executing recovery.\n", caller, |
225 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, | 227 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, |
226 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, | 228 | ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, |
@@ -605,7 +607,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
605 | VirtDevice *vdevice; | 607 | VirtDevice *vdevice; |
606 | struct scsi_target *starget; | 608 | struct scsi_target *starget; |
607 | struct fc_rport *rport; | 609 | struct fc_rport *rport; |
608 | 610 | MPT_ADAPTER *ioc; | |
609 | 611 | ||
610 | starget = scsi_target(sdev); | 612 | starget = scsi_target(sdev); |
611 | rport = starget_to_rport(starget); | 613 | rport = starget_to_rport(starget); |
@@ -614,11 +616,12 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
614 | return -ENXIO; | 616 | return -ENXIO; |
615 | 617 | ||
616 | hd = (MPT_SCSI_HOST *)sdev->host->hostdata; | 618 | hd = (MPT_SCSI_HOST *)sdev->host->hostdata; |
619 | ioc = hd->ioc; | ||
617 | 620 | ||
618 | vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); | 621 | vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); |
619 | if (!vdevice) { | 622 | if (!vdevice) { |
620 | printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", | 623 | printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", |
621 | hd->ioc->name, sizeof(VirtDevice)); | 624 | ioc->name, sizeof(VirtDevice)); |
622 | return -ENOMEM; | 625 | return -ENOMEM; |
623 | } | 626 | } |
624 | 627 | ||
@@ -627,7 +630,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
627 | vtarget = starget->hostdata; | 630 | vtarget = starget->hostdata; |
628 | 631 | ||
629 | if (vtarget->num_luns == 0) { | 632 | if (vtarget->num_luns == 0) { |
630 | vtarget->ioc_id = hd->ioc->id; | 633 | vtarget->ioc_id = ioc->id; |
631 | vtarget->tflags = MPT_TARGET_FLAGS_Q_YES; | 634 | vtarget->tflags = MPT_TARGET_FLAGS_Q_YES; |
632 | } | 635 | } |
633 | 636 | ||
@@ -637,7 +640,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
637 | vtarget->num_luns++; | 640 | vtarget->num_luns++; |
638 | 641 | ||
639 | 642 | ||
640 | mptfc_dump_lun_info(hd->ioc, rport, sdev, vtarget); | 643 | mptfc_dump_lun_info(ioc, rport, sdev, vtarget); |
641 | 644 | ||
642 | return 0; | 645 | return 0; |
643 | } | 646 | } |