diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-03-23 11:10:18 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-04-11 22:57:09 +0200 |
commit | 438af51c642926f1c1844846bee1c3fb568dcd64 (patch) | |
tree | d499b808b5aff4ba0c5bf151d06ffcd20d563da8 /drivers/scsi/arm | |
parent | ncr5380: Use DMA hooks for PDMA (diff) | |
download | linux-438af51c642926f1c1844846bee1c3fb568dcd64.tar.xz linux-438af51c642926f1c1844846bee1c3fb568dcd64.zip |
ncr5380: Adopt uniform DMA setup convention
Standardize the DMA setup hooks so that the DMA implementation in
atari_NCR5380.c can be reconciled with pseudo DMA implementation in
NCR5380.c.
Calls to NCR5380_dma_recv_setup() and NCR5380_dma_send_setup() return
a negative value on failure, zero on PDMA transfer success and a positive
byte count for DMA setup success.
This convention is not entirely new, but is now applied consistently.
Also remove a pointless Status Register access: the *phase assignment is
redundant because after NCR5380_transfer_dma() returns control to
NCR5380_information_transfer(), that routine then returns control
to NCR5380_main(), which means *phase is dead.
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/arm')
-rw-r--r-- | drivers/scsi/arm/cumana_1.c | 10 | ||||
-rw-r--r-- | drivers/scsi/arm/oak.c | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c index 7bcb66893059..402d984aa088 100644 --- a/drivers/scsi/arm/cumana_1.c +++ b/drivers/scsi/arm/cumana_1.c @@ -101,7 +101,10 @@ static inline int cumanascsi_pwrite(struct Scsi_Host *host, } end: writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); - return len; + + if (len) + return -1; + return 0; } static inline int cumanascsi_pread(struct Scsi_Host *host, @@ -163,7 +166,10 @@ static inline int cumanascsi_pread(struct Scsi_Host *host, } end: writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); - return len; + + if (len) + return -1; + return 0; } static unsigned char cumanascsi_read(struct Scsi_Host *host, unsigned int reg) diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c index 5d6e0e590638..05cf874fc739 100644 --- a/drivers/scsi/arm/oak.c +++ b/drivers/scsi/arm/oak.c @@ -47,13 +47,13 @@ static inline int oakscsi_pwrite(struct Scsi_Host *instance, void __iomem *base = priv(instance)->base; printk("writing %p len %d\n",addr, len); - if(!len) return -1; while(1) { int status; while (((status = readw(base + STAT)) & 0x100)==0); } + return 0; } static inline int oakscsi_pread(struct Scsi_Host *instance, @@ -74,7 +74,7 @@ printk("reading %p len %d\n", addr, len); if(status & 0x200 || !timeout) { printk("status = %08X\n", status); - return 1; + return -1; } } |