Commit 5743aaac authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: 8253: mmio address is a void __iomem *

The inline functions for accessing a memory mapped 8254 device
are using a void * for the 'base_address' of the device. Memory
mapped io using the read/write functions should be using a
void __iomem * for the address.

Fixing these exposed a couple other void * / void __iomem *
issues in the ni_labpc driver.

This fixes a number of sparse warnings like:

  warning: incorrect type in argument 2 (different address spaces)
     expected void volatile [noderef] <asn:2>*addr
     got void *

  warning: incorrect type in argument 1 (different address spaces)
     expected void const volatile [noderef] <asn:2>*addr
     got void *<noident>
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f5cc359
...@@ -262,8 +262,10 @@ static inline int i8254_load(unsigned long base_address, unsigned int regshift, ...@@ -262,8 +262,10 @@ static inline int i8254_load(unsigned long base_address, unsigned int regshift,
return 0; return 0;
} }
static inline int i8254_mm_load(void *base_address, unsigned int regshift, static inline int i8254_mm_load(void __iomem *base_address,
unsigned int counter_number, unsigned int count, unsigned int regshift,
unsigned int counter_number,
unsigned int count,
unsigned int mode) unsigned int mode)
{ {
unsigned int byte; unsigned int byte;
...@@ -311,7 +313,8 @@ static inline int i8254_read(unsigned long base_address, unsigned int regshift, ...@@ -311,7 +313,8 @@ static inline int i8254_read(unsigned long base_address, unsigned int regshift,
return ret; return ret;
} }
static inline int i8254_mm_read(void *base_address, unsigned int regshift, static inline int i8254_mm_read(void __iomem *base_address,
unsigned int regshift,
unsigned int counter_number) unsigned int counter_number)
{ {
unsigned int byte; unsigned int byte;
...@@ -348,7 +351,7 @@ static inline void i8254_write(unsigned long base_address, ...@@ -348,7 +351,7 @@ static inline void i8254_write(unsigned long base_address,
outb(byte, base_address + (counter_number << regshift)); outb(byte, base_address + (counter_number << regshift));
} }
static inline void i8254_mm_write(void *base_address, static inline void i8254_mm_write(void __iomem *base_address,
unsigned int regshift, unsigned int regshift,
unsigned int counter_number, unsigned int counter_number,
unsigned int count) unsigned int count)
...@@ -390,7 +393,7 @@ static inline int i8254_set_mode(unsigned long base_address, ...@@ -390,7 +393,7 @@ static inline int i8254_set_mode(unsigned long base_address,
return 0; return 0;
} }
static inline int i8254_mm_set_mode(void *base_address, static inline int i8254_mm_set_mode(void __iomem *base_address,
unsigned int regshift, unsigned int regshift,
unsigned int counter_number, unsigned int counter_number,
unsigned int mode) unsigned int mode)
...@@ -419,7 +422,7 @@ static inline int i8254_status(unsigned long base_address, ...@@ -419,7 +422,7 @@ static inline int i8254_status(unsigned long base_address,
return inb(base_address + (counter_number << regshift)); return inb(base_address + (counter_number << regshift));
} }
static inline int i8254_mm_status(void *base_address, static inline int i8254_mm_status(void __iomem *base_address,
unsigned int regshift, unsigned int regshift,
unsigned int counter_number) unsigned int counter_number)
{ {
......
...@@ -409,12 +409,12 @@ static inline void labpc_outb(unsigned int byte, unsigned long address) ...@@ -409,12 +409,12 @@ static inline void labpc_outb(unsigned int byte, unsigned long address)
static inline unsigned int labpc_readb(unsigned long address) static inline unsigned int labpc_readb(unsigned long address)
{ {
return readb((void *)address); return readb((void __iomem *)address);
} }
static inline void labpc_writeb(unsigned int byte, unsigned long address) static inline void labpc_writeb(unsigned int byte, unsigned long address)
{ {
writeb(byte, (void *)address); writeb(byte, (void __iomem *)address);
} }
static const struct labpc_board_struct labpc_boards[] = { static const struct labpc_board_struct labpc_boards[] = {
...@@ -494,8 +494,8 @@ static inline int labpc_counter_load(struct comedi_device *dev, ...@@ -494,8 +494,8 @@ static inline int labpc_counter_load(struct comedi_device *dev,
unsigned int count, unsigned int mode) unsigned int count, unsigned int mode)
{ {
if (thisboard->memory_mapped_io) if (thisboard->memory_mapped_io)
return i8254_mm_load((void *)base_address, 0, counter_number, return i8254_mm_load((void __iomem *)base_address, 0,
count, mode); counter_number, count, mode);
else else
return i8254_load(base_address, 0, counter_number, count, mode); return i8254_load(base_address, 0, counter_number, count, mode);
} }
...@@ -1896,10 +1896,10 @@ static int labpc_dio_mem_callback(int dir, int port, int data, ...@@ -1896,10 +1896,10 @@ static int labpc_dio_mem_callback(int dir, int port, int data,
unsigned long iobase) unsigned long iobase)
{ {
if (dir) { if (dir) {
writeb(data, (void *)(iobase + port)); writeb(data, (void __iomem *)(iobase + port));
return 0; return 0;
} else { } else {
return readb((void *)(iobase + port)); return readb((void __iomem *)(iobase + port));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment