diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2014-11-12 16:11:59 +1100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-20 09:11:09 +0100 |
commit | a9c2dc43c14cc9e9333d451bc4db8a827a695332 (patch) | |
tree | 70e239cb8ebf6f09fa6d4c37cb3cc2884a37d144 /drivers/scsi/dtc.c | |
parent | 8c32513bd395dc5d382e4883097482567cf8bbc5 (diff) | |
download | linux-a9c2dc43c14cc9e9333d451bc4db8a827a695332.tar.bz2 |
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 <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/dtc.c')
-rw-r--r-- | drivers/scsi/dtc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c index 2dacf2833b64..62b8de67f65f 100644 --- a/drivers/scsi/dtc.c +++ b/drivers/scsi/dtc.c @@ -332,13 +332,11 @@ static int dtc_biosparam(struct scsi_device *sdev, struct block_device *dev, * timeout. */ -static int dtc_maxi = 0; -static int dtc_wmaxi = 0; - static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, int len) { unsigned char *d = dst; int i; /* For counting time spent in the poll-loop */ + struct NCR5380_hostdata *hostdata = shost_priv(instance); NCR5380_local_declare(); NCR5380_setup(instance); @@ -369,8 +367,8 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, NCR5380_write(MODE_REG, 0); /* Clear the operating mode */ rtrc(0); NCR5380_read(RESET_PARITY_INTERRUPT_REG); - if (i > dtc_maxi) - dtc_maxi = i; + if (i > hostdata->spin_max_r) + hostdata->spin_max_r = i; return (0); } @@ -390,6 +388,7 @@ static inline int NCR5380_pread(struct Scsi_Host *instance, unsigned char *dst, static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, int len) { int i; + struct NCR5380_hostdata *hostdata = shost_priv(instance); NCR5380_local_declare(); NCR5380_setup(instance); @@ -422,8 +421,8 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src, /* Check for parity error here. fixme. */ NCR5380_write(MODE_REG, 0); /* Clear the operating mode */ rtrc(0); - if (i > dtc_wmaxi) - dtc_wmaxi = i; + if (i > hostdata->spin_max_w) + hostdata->spin_max_w = i; return (0); } |