diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-03-23 06:10:18 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-04-11 16:57:09 -0400 |
commit | 438af51c642926f1c1844846bee1c3fb568dcd64 (patch) | |
tree | d499b808b5aff4ba0c5bf151d06ffcd20d563da8 /drivers/scsi/arm | |
parent | 6c4b88ca59ba1a68f707f19dba1744ed19e89fce (diff) |
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, | |||
101 | } | 101 | } |
102 | end: | 102 | end: |
103 | writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); | 103 | writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); |
104 | return len; | 104 | |
105 | if (len) | ||
106 | return -1; | ||
107 | return 0; | ||
105 | } | 108 | } |
106 | 109 | ||
107 | static inline int cumanascsi_pread(struct Scsi_Host *host, | 110 | static inline int cumanascsi_pread(struct Scsi_Host *host, |
@@ -163,7 +166,10 @@ static inline int cumanascsi_pread(struct Scsi_Host *host, | |||
163 | } | 166 | } |
164 | end: | 167 | end: |
165 | writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); | 168 | writeb(priv(host)->ctrl | 0x40, priv(host)->base + CTRL); |
166 | return len; | 169 | |
170 | if (len) | ||
171 | return -1; | ||
172 | return 0; | ||
167 | } | 173 | } |
168 | 174 | ||
169 | static unsigned char cumanascsi_read(struct Scsi_Host *host, unsigned int reg) | 175 | 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, | |||
47 | void __iomem *base = priv(instance)->base; | 47 | void __iomem *base = priv(instance)->base; |
48 | 48 | ||
49 | printk("writing %p len %d\n",addr, len); | 49 | printk("writing %p len %d\n",addr, len); |
50 | if(!len) return -1; | ||
51 | 50 | ||
52 | while(1) | 51 | while(1) |
53 | { | 52 | { |
54 | int status; | 53 | int status; |
55 | while (((status = readw(base + STAT)) & 0x100)==0); | 54 | while (((status = readw(base + STAT)) & 0x100)==0); |
56 | } | 55 | } |
56 | return 0; | ||
57 | } | 57 | } |
58 | 58 | ||
59 | static inline int oakscsi_pread(struct Scsi_Host *instance, | 59 | static inline int oakscsi_pread(struct Scsi_Host *instance, |
@@ -74,7 +74,7 @@ printk("reading %p len %d\n", addr, len); | |||
74 | if(status & 0x200 || !timeout) | 74 | if(status & 0x200 || !timeout) |
75 | { | 75 | { |
76 | printk("status = %08X\n", status); | 76 | printk("status = %08X\n", status); |
77 | return 1; | 77 | return -1; |
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||