aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/mac_scsi.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2016-10-10 00:46:53 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2016-11-08 17:29:48 -0500
commitd5d37a0ab13b8f4ccfa58a4e852e19bcbf47ed5e (patch)
tree7b00961b69ab88a4c4d84cf151b232927d190421 /drivers/scsi/mac_scsi.c
parent61e1ce588b101f13a4c6f713b95d65551c8572e3 (diff)
scsi: ncr5380: Pass hostdata pointer to register polling routines
Pass a NCR5380_hostdata struct pointer to the board-specific routines instead of a Scsi_Host struct pointer. This reduces pointer chasing in the PIO and PDMA fast paths. The old way was a mistake because it is slow and the board-specific code is not concerned with the mid-layer. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mac_scsi.c')
-rw-r--r--drivers/scsi/mac_scsi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 9ac38229c02d..07f956c18266 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -161,7 +161,7 @@ static int macscsi_pread(struct Scsi_Host *instance,
int n = len;
int transferred;
- while (!NCR5380_poll_politely(instance, BUS_AND_STATUS_REG,
+ while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
BASR_DRQ | BASR_PHASE_MATCH,
BASR_DRQ | BASR_PHASE_MATCH, HZ / 64)) {
CP_IO_TO_MEM(s, d, n);
@@ -174,7 +174,7 @@ static int macscsi_pread(struct Scsi_Host *instance,
return 0;
/* Target changed phase early? */
- if (NCR5380_poll_politely2(instance, STATUS_REG, SR_REQ, SR_REQ,
+ if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ,
BUS_AND_STATUS_REG, BASR_ACK, BASR_ACK, HZ / 64) < 0)
scmd_printk(KERN_ERR, hostdata->connected,
"%s: !REQ and !ACK\n", __func__);
@@ -264,7 +264,7 @@ static int macscsi_pwrite(struct Scsi_Host *instance,
int n = len;
int transferred;
- while (!NCR5380_poll_politely(instance, BUS_AND_STATUS_REG,
+ while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
BASR_DRQ | BASR_PHASE_MATCH,
BASR_DRQ | BASR_PHASE_MATCH, HZ / 64)) {
CP_MEM_TO_IO(s, d, n);
@@ -273,7 +273,7 @@ static int macscsi_pwrite(struct Scsi_Host *instance,
hostdata->pdma_residual = len - transferred;
/* Target changed phase early? */
- if (NCR5380_poll_politely2(instance, STATUS_REG, SR_REQ, SR_REQ,
+ if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ,
BUS_AND_STATUS_REG, BASR_ACK, BASR_ACK, HZ / 64) < 0)
scmd_printk(KERN_ERR, hostdata->connected,
"%s: !REQ and !ACK\n", __func__);
@@ -282,7 +282,7 @@ static int macscsi_pwrite(struct Scsi_Host *instance,
/* No bus error. */
if (n == 0) {
- if (NCR5380_poll_politely(instance, TARGET_COMMAND_REG,
+ if (NCR5380_poll_politely(hostdata, TARGET_COMMAND_REG,
TCR_LAST_BYTE_SENT,
TCR_LAST_BYTE_SENT, HZ / 64) < 0)
scmd_printk(KERN_ERR, hostdata->connected,