diff options
author | Finn Thain <fthain@telegraphics.com.au> | 2016-10-10 00:46:53 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-11-08 17:29:48 -0500 |
commit | 61e1ce588b101f13a4c6f713b95d65551c8572e3 (patch) | |
tree | 1f573de63f995733b53184450afafd8c0ff54892 /drivers/scsi/arm | |
parent | 820682b1b34ebb97434c4abc00c744870364e2be (diff) | |
download | linux-61e1ce588b101f13a4c6f713b95d65551c8572e3.tar.bz2 |
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 <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ondrej Zary <linux@rainbow-software.org>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
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 | 20 | ||||
-rw-r--r-- | drivers/scsi/arm/oak.c | 6 |
2 files changed, 13 insertions, 13 deletions
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 <scsi/scsi_host.h> #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 |