From a9c2dc43c14cc9e9333d451bc4db8a827a695332 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Wed, 12 Nov 2014 16:11:59 +1100 Subject: ncr5380: Move static PDMA spin counters to host data Static variables from dtc.c and pas16.c should not appear in the core NCR5380.c driver. Aside from being a layering issue this worsens the divergence between the three core driver variants (atari_NCR5380.c and sun3_NCR5380.c don't support PSEUDO_DMA) and it can mean multiple hosts share the same counters. Fix this by making the pseudo DMA spin counters in the core more generic. This also avoids the abuse of the {DTC,PAS16}_PUBLIC_RELEASE macros, so they can be removed. oak.c doesn't use PDMA and hence it doesn't use the counters and hence it needs no write_info() method. Remove it. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Michael Schmitz Signed-off-by: Christoph Hellwig --- drivers/scsi/pas16.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/scsi/pas16.c') diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c index 51766895e90e..7994b5275431 100644 --- a/drivers/scsi/pas16.c +++ b/drivers/scsi/pas16.c @@ -88,8 +88,6 @@ #include "NCR5380.h" -static int pas_maxi = 0; -static int pas_wmaxi = 0; static unsigned short pas16_addr = 0; static int pas16_irq = 0; @@ -502,6 +500,7 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst, P_DATA_REG_OFFSET); register int i = len; int ii = 0; + struct NCR5380_hostdata *hostdata = shost_priv(instance); while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) ) ++ii; @@ -514,8 +513,8 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst, instance->host_no); return -1; } - if (ii > pas_maxi) - pas_maxi = ii; + if (ii > hostdata->spin_max_r) + hostdata->spin_max_r = ii; return 0; } @@ -538,6 +537,7 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET); register int i = len; int ii = 0; + struct NCR5380_hostdata *hostdata = shost_priv(instance); while ( !((inb(instance->io_port + P_STATUS_REG_OFFSET)) & P_ST_RDY) ) ++ii; @@ -550,8 +550,8 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src instance->host_no); return -1; } - if (ii > pas_maxi) - pas_wmaxi = ii; + if (ii > hostdata->spin_max_w) + hostdata->spin_max_w = ii; return 0; } -- cgit v1.2.3