From 61e1ce588b101f13a4c6f713b95d65551c8572e3 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Mon, 10 Oct 2016 00:46:53 -0400 Subject: scsi: ncr5380: Use correct types for device register accessors For timeout values adopt unsigned long, which is the type of jiffies etc. For chip register values and bit masks pass u8, which is the return type of readb, inb etc. For device register offsets adopt unsigned int, as it is suitable for adding to base addresses. Pass the NCR5380_hostdata pointer to the board-specific routines instead of the Scsi_Host pointer. The board-specific code is concerned with hardware and not with SCSI protocol or the mid-layer. Signed-off-by: Finn Thain Reviewed-by: Hannes Reinecke Tested-by: Ondrej Zary Tested-by: Michael Schmitz Acked-by: Russell King Signed-off-by: Martin K. Petersen --- drivers/scsi/arm/cumana_1.c | 20 +++++++++++--------- drivers/scsi/arm/oak.c | 6 ++---- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'drivers/scsi/arm') diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c index 88db2816f97c..ae1d4c6786de 100644 --- a/drivers/scsi/arm/cumana_1.c +++ b/drivers/scsi/arm/cumana_1.c @@ -14,8 +14,8 @@ #include #define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) -#define NCR5380_read(reg) cumanascsi_read(instance, reg) -#define NCR5380_write(reg, value) cumanascsi_write(instance, reg, value) +#define NCR5380_read(reg) cumanascsi_read(hostdata, reg) +#define NCR5380_write(reg, value) cumanascsi_write(hostdata, reg, value) #define NCR5380_dma_xfer_len(instance, cmd, phase) (cmd->transfersize) #define NCR5380_dma_recv_setup cumanascsi_pread @@ -169,30 +169,32 @@ end: return 0; } -static unsigned char cumanascsi_read(struct Scsi_Host *host, unsigned int reg) +static u8 cumanascsi_read(struct NCR5380_hostdata *hostdata, + unsigned int reg) { - u8 __iomem *base = priv(host)->io; - unsigned char val; + u8 __iomem *base = hostdata->io; + u8 val; writeb(0, base + CTRL); val = readb(base + 0x2100 + (reg << 2)); - priv(host)->ctrl = 0x40; + hostdata->ctrl = 0x40; writeb(0x40, base + CTRL); return val; } -static void cumanascsi_write(struct Scsi_Host *host, unsigned int reg, unsigned int value) +static void cumanascsi_write(struct NCR5380_hostdata *hostdata, + unsigned int reg, u8 value) { - u8 __iomem *base = priv(host)->io; + u8 __iomem *base = hostdata->io; writeb(0, base + CTRL); writeb(value, base + 0x2100 + (reg << 2)); - priv(host)->ctrl = 0x40; + hostdata->ctrl = 0x40; writeb(0x40, base + CTRL); } diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c index 1c4a44a1e62d..d320f88c32c4 100644 --- a/drivers/scsi/arm/oak.c +++ b/drivers/scsi/arm/oak.c @@ -16,10 +16,8 @@ #define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) -#define NCR5380_read(reg) \ - readb(priv(instance)->io + ((reg) << 2)) -#define NCR5380_write(reg, value) \ - writeb(value, priv(instance)->io + ((reg) << 2)) +#define NCR5380_read(reg) readb(hostdata->io + ((reg) << 2)) +#define NCR5380_write(reg, value) writeb(value, hostdata->io + ((reg) << 2)) #define NCR5380_dma_xfer_len(instance, cmd, phase) (0) #define NCR5380_dma_recv_setup oakscsi_pread -- cgit v1.2.3