summaryrefslogtreecommitdiff
path: root/drivers/scsi/arm/oak.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-22 17:13:15 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-22 17:13:15 -0800
commit4adea1fd2773a88c30ecd77d4e5d256fa40908e2 (patch)
tree399609f18a20a2611653d2e58bb0bd4a6797163f /drivers/scsi/arm/oak.c
parent2c9b3ebd5913c2d1371b749a8057ac32972b410d (diff)
parent60539fa3a1e3caf458a943b1a14154e3fa44d0d1 (diff)
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull more SCSI updates from James Bottomley: "This is mostly stuff which missed the first pull request because it needed to incubate longer. It's mainly made up of the ncr 5380 rework but also has a few assorted bug fixes" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (88 commits) imm: Use new parport device model megaraid: Fix possible NULL pointer deference in mraid_mm_ioctl storvsc: Fix typo in MODULE_PARM_DESC cxgbi: Typo in MODULE_PARM_DESC 3w-xxxx: Pass through compat mode ioctls hisi_sas: Use u64 for qw0 in free_device_v1_hw() hisi_sas: Fix typo in setup_itct_v1_hw() hisi_sas: Fix v1 itct masks ipr: Fix out-of-bounds null overwrite scsi: add Synology to 1024 sector blacklist ncr5380: Add support for HP C2502 ncr5380: Fix wait for 53C80 registers registers after PDMA ncr5380: Enable PDMA for DTC chips ncr5380: Enable PDMA for NCR53C400A ncr5380: Use runtime register mapping ncr5380: Fix pseudo DMA transfers on 53C400 ncr5380: Cleanup whitespace and parentheses atari_NCR5380: Merge changes from NCR5380.c ncr5380: Merge changes from atari_NCR5380.c ncr5380: Fix whitespace in comments using regexp ...
Diffstat (limited to 'drivers/scsi/arm/oak.c')
-rw-r--r--drivers/scsi/arm/oak.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index 7c6fa1479c9c..1fab1d1896b1 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -5,9 +5,7 @@
*/
#include <linux/module.h>
-#include <linux/signal.h>
#include <linux/ioport.h>
-#include <linux/delay.h>
#include <linux/blkdev.h>
#include <linux/init.h>
@@ -20,14 +18,16 @@
#define DONT_USE_INTR
#define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata)
-#define NCR5380_local_declare() void __iomem *_base
-#define NCR5380_setup(host) _base = priv(host)->base
-#define NCR5380_read(reg) readb(_base + ((reg) << 2))
-#define NCR5380_write(reg, value) writeb(value, _base + ((reg) << 2))
+#define NCR5380_read(reg) \
+ readb(priv(instance)->base + ((reg) << 2))
+#define NCR5380_write(reg, value) \
+ writeb(value, priv(instance)->base + ((reg) << 2))
+
+#define NCR5380_dma_xfer_len(instance, cmd, phase) (cmd->transfersize)
+
#define NCR5380_queue_command oakscsi_queue_command
#define NCR5380_info oakscsi_info
-#define NCR5380_show_info oakscsi_show_info
#define NCR5380_implementation_fields \
void __iomem *base
@@ -103,7 +103,6 @@ printk("reading %p len %d\n", addr, len);
static struct scsi_host_template oakscsi_template = {
.module = THIS_MODULE,
- .show_info = oakscsi_show_info,
.name = "Oak 16-bit SCSI",
.info = oakscsi_info,
.queuecommand = oakscsi_queue_command,
@@ -115,6 +114,8 @@ static struct scsi_host_template oakscsi_template = {
.cmd_per_lun = 2,
.use_clustering = DISABLE_CLUSTERING,
.proc_name = "oakscsi",
+ .cmd_size = NCR5380_CMD_SIZE,
+ .max_sectors = 128,
};
static int oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
@@ -142,15 +143,21 @@ static int oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
host->irq = NO_IRQ;
host->n_io_port = 255;
- NCR5380_init(host, 0);
+ ret = NCR5380_init(host, 0);
+ if (ret)
+ goto out_unmap;
+
+ NCR5380_maybe_reset_bus(host);
ret = scsi_add_host(host, &ec->dev);
if (ret)
- goto out_unmap;
+ goto out_exit;
scsi_scan_host(host);
goto out;
+ out_exit:
+ NCR5380_exit(host);
out_unmap:
iounmap(priv(host)->base);
unreg: