aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptfc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptfc.c')
-rw-r--r--drivers/message/fusion/mptfc.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 19438ecc47a6..df1e6faebf19 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -196,7 +196,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
196 int ready; 196 int ready;
197 MPT_ADAPTER *ioc; 197 MPT_ADAPTER *ioc;
198 198
199 hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata; 199 hd = shost_priv(SCpnt->device->host);
200 ioc = hd->ioc; 200 ioc = hd->ioc;
201 spin_lock_irqsave(shost->host_lock, flags); 201 spin_lock_irqsave(shost->host_lock, flags);
202 while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) { 202 while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) {
@@ -204,8 +204,7 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
204 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT 204 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
205 "mptfc_block_error_handler.%d: %d:%d, port status is " 205 "mptfc_block_error_handler.%d: %d:%d, port status is "
206 "DID_IMM_RETRY, deferring %s recovery.\n", 206 "DID_IMM_RETRY, deferring %s recovery.\n",
207 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, 207 ioc->name, ioc->sh->host_no,
208 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
209 SCpnt->device->id, SCpnt->device->lun, caller)); 208 SCpnt->device->id, SCpnt->device->lun, caller));
210 msleep(1000); 209 msleep(1000);
211 spin_lock_irqsave(shost->host_lock, flags); 210 spin_lock_irqsave(shost->host_lock, flags);
@@ -216,16 +215,14 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
216 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT 215 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
217 "%s.%d: %d:%d, failing recovery, " 216 "%s.%d: %d:%d, failing recovery, "
218 "port state %d, vdevice %p.\n", caller, 217 "port state %d, vdevice %p.\n", caller,
219 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, 218 ioc->name, ioc->sh->host_no,
220 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
221 SCpnt->device->id, SCpnt->device->lun, ready, 219 SCpnt->device->id, SCpnt->device->lun, ready,
222 SCpnt->device->hostdata)); 220 SCpnt->device->hostdata));
223 return FAILED; 221 return FAILED;
224 } 222 }
225 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT 223 dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
226 "%s.%d: %d:%d, executing recovery.\n", caller, 224 "%s.%d: %d:%d, executing recovery.\n", caller,
227 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, 225 ioc->name, ioc->sh->host_no,
228 ((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
229 SCpnt->device->id, SCpnt->device->lun)); 226 SCpnt->device->id, SCpnt->device->lun));
230 return (*func)(SCpnt); 227 return (*func)(SCpnt);
231} 228}
@@ -615,7 +612,7 @@ mptfc_slave_alloc(struct scsi_device *sdev)
615 if (!rport || fc_remote_port_chkready(rport)) 612 if (!rport || fc_remote_port_chkready(rport))
616 return -ENXIO; 613 return -ENXIO;
617 614
618 hd = (MPT_SCSI_HOST *)sdev->host->hostdata; 615 hd = shost_priv(sdev->host);
619 ioc = hd->ioc; 616 ioc = hd->ioc;
620 617
621 vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); 618 vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
@@ -1279,7 +1276,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1279 1276
1280 spin_unlock_irqrestore(&ioc->FreeQlock, flags); 1277 spin_unlock_irqrestore(&ioc->FreeQlock, flags);
1281 1278
1282 hd = (MPT_SCSI_HOST *) sh->hostdata; 1279 hd = shost_priv(sh);
1283 hd->ioc = ioc; 1280 hd->ioc = ioc;
1284 1281
1285 /* SCSI needs scsi_cmnd lookup table! 1282 /* SCSI needs scsi_cmnd lookup table!
@@ -1386,7 +1383,7 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
1386 ioc->name, event)); 1383 ioc->name, event));
1387 1384
1388 if (ioc->sh == NULL || 1385 if (ioc->sh == NULL ||
1389 ((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL)) 1386 ((hd = shost_priv(ioc->sh)) == NULL))
1390 return 1; 1387 return 1;
1391 1388
1392 switch (event) { 1389 switch (event) {