Commit f31d0008 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: comedi: cb_pcidas64.c: fix sparse warnings

This fixes a bunch of iomem and other sparse warnings.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d18c5906
...@@ -1101,9 +1101,9 @@ struct pcidas64_private { ...@@ -1101,9 +1101,9 @@ struct pcidas64_private {
resource_size_t main_phys_iobase; resource_size_t main_phys_iobase;
resource_size_t dio_counter_phys_iobase; resource_size_t dio_counter_phys_iobase;
/* base addresses (ioremapped) */ /* base addresses (ioremapped) */
void *plx9080_iobase; void __iomem *plx9080_iobase;
void *main_iobase; void __iomem *main_iobase;
void *dio_counter_iobase; void __iomem *dio_counter_iobase;
/* local address (used by dma controller) */ /* local address (used by dma controller) */
uint32_t local0_iobase; uint32_t local0_iobase;
uint32_t local1_iobase; uint32_t local1_iobase;
...@@ -1183,8 +1183,8 @@ static int ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -1183,8 +1183,8 @@ static int ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
static irqreturn_t handle_interrupt(int irq, void *d); static irqreturn_t handle_interrupt(int irq, void *d);
static int ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s); static int ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
static int ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s); static int ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
static int dio_callback(int dir, int port, int data, unsigned long arg); static int dio_callback(int dir, int port, int data, void __iomem *base);
static int dio_callback_4020(int dir, int port, int data, unsigned long arg); static int dio_callback_4020(int dir, int port, int data, void __iomem *base);
static int di_rbits(struct comedi_device *dev, struct comedi_subdevice *s, static int di_rbits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
static int do_wbits(struct comedi_device *dev, struct comedi_subdevice *s, static int do_wbits(struct comedi_device *dev, struct comedi_subdevice *s,
...@@ -1316,7 +1316,7 @@ static inline int ao_cmd_is_supported(const struct pcidas64_board *board) ...@@ -1316,7 +1316,7 @@ static inline int ao_cmd_is_supported(const struct pcidas64_board *board)
static void init_plx9080(struct comedi_device *dev) static void init_plx9080(struct comedi_device *dev)
{ {
uint32_t bits; uint32_t bits;
void *plx_iobase = priv(dev)->plx9080_iobase; void __iomem *plx_iobase = priv(dev)->plx9080_iobase;
priv(dev)->plx_control_bits = priv(dev)->plx_control_bits =
readl(priv(dev)->plx9080_iobase + PLX_CONTROL_REG); readl(priv(dev)->plx9080_iobase + PLX_CONTROL_REG);
...@@ -1406,7 +1406,7 @@ static void init_plx9080(struct comedi_device *dev) ...@@ -1406,7 +1406,7 @@ static void init_plx9080(struct comedi_device *dev)
static int setup_subdevices(struct comedi_device *dev) static int setup_subdevices(struct comedi_device *dev)
{ {
struct comedi_subdevice *s; struct comedi_subdevice *s;
void *dio_8255_iobase; void __iomem *dio_8255_iobase;
int i; int i;
if (alloc_subdevices(dev, 10) < 0) if (alloc_subdevices(dev, 10) < 0)
...@@ -1432,7 +1432,6 @@ static int setup_subdevices(struct comedi_device *dev) ...@@ -1432,7 +1432,6 @@ static int setup_subdevices(struct comedi_device *dev)
s->do_cmdtest = ai_cmdtest; s->do_cmdtest = ai_cmdtest;
s->cancel = ai_cancel; s->cancel = ai_cancel;
if (board(dev)->layout == LAYOUT_4020) { if (board(dev)->layout == LAYOUT_4020) {
unsigned int i;
uint8_t data; uint8_t data;
/* set adc to read from inputs (not internal calibration sources) */ /* set adc to read from inputs (not internal calibration sources) */
priv(dev)->i2c_cal_range_bits = adc_src_4020_bits(4); priv(dev)->i2c_cal_range_bits = adc_src_4020_bits(4);
...@@ -1614,7 +1613,7 @@ static void init_stc_registers(struct comedi_device *dev) ...@@ -1614,7 +1613,7 @@ static void init_stc_registers(struct comedi_device *dev)
disable_ai_pacing(dev); disable_ai_pacing(dev);
}; };
int alloc_and_init_dma_members(struct comedi_device *dev) static int alloc_and_init_dma_members(struct comedi_device *dev)
{ {
int i; int i;
...@@ -1877,12 +1876,12 @@ static int detach(struct comedi_device *dev) ...@@ -1877,12 +1876,12 @@ static int detach(struct comedi_device *dev)
if (priv(dev)->hw_dev) { if (priv(dev)->hw_dev) {
if (priv(dev)->plx9080_iobase) { if (priv(dev)->plx9080_iobase) {
disable_plx_interrupts(dev); disable_plx_interrupts(dev);
iounmap((void *)priv(dev)->plx9080_iobase); iounmap(priv(dev)->plx9080_iobase);
} }
if (priv(dev)->main_iobase) if (priv(dev)->main_iobase)
iounmap((void *)priv(dev)->main_iobase); iounmap(priv(dev)->main_iobase);
if (priv(dev)->dio_counter_iobase) if (priv(dev)->dio_counter_iobase)
iounmap((void *)priv(dev)->dio_counter_iobase); iounmap(priv(dev)->dio_counter_iobase);
/* free pci dma buffers */ /* free pci dma buffers */
for (i = 0; i < ai_dma_ring_count(board(dev)); i++) { for (i = 0; i < ai_dma_ring_count(board(dev)); i++) {
if (priv(dev)->ai_buffer[i]) if (priv(dev)->ai_buffer[i])
...@@ -2978,7 +2977,7 @@ static void drain_dma_buffers(struct comedi_device *dev, unsigned int channel) ...@@ -2978,7 +2977,7 @@ static void drain_dma_buffers(struct comedi_device *dev, unsigned int channel)
uint32_t next_transfer_addr; uint32_t next_transfer_addr;
int j; int j;
int num_samples = 0; int num_samples = 0;
void *pci_addr_reg; void __iomem *pci_addr_reg;
if (channel) if (channel)
pci_addr_reg = pci_addr_reg =
...@@ -3018,8 +3017,9 @@ static void drain_dma_buffers(struct comedi_device *dev, unsigned int channel) ...@@ -3018,8 +3017,9 @@ static void drain_dma_buffers(struct comedi_device *dev, unsigned int channel)
* unused buffer) */ * unused buffer) */
} }
void handle_ai_interrupt(struct comedi_device *dev, unsigned short status, static void handle_ai_interrupt(struct comedi_device *dev,
unsigned int plx_status) unsigned short status,
unsigned int plx_status)
{ {
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
struct comedi_async *async = s->async; struct comedi_async *async = s->async;
...@@ -3229,7 +3229,7 @@ static irqreturn_t handle_interrupt(int irq, void *d) ...@@ -3229,7 +3229,7 @@ static irqreturn_t handle_interrupt(int irq, void *d)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
void abort_dma(struct comedi_device *dev, unsigned int channel) static void abort_dma(struct comedi_device *dev, unsigned int channel)
{ {
unsigned long flags; unsigned long flags;
...@@ -3424,7 +3424,7 @@ static void load_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd) ...@@ -3424,7 +3424,7 @@ static void load_ao_dma(struct comedi_device *dev, const struct comedi_cmd *cmd)
{ {
unsigned int num_bytes; unsigned int num_bytes;
unsigned int next_transfer_addr; unsigned int next_transfer_addr;
void *pci_addr_reg = void __iomem *pci_addr_reg =
priv(dev)->plx9080_iobase + PLX_DMA0_PCI_ADDRESS_REG; priv(dev)->plx9080_iobase + PLX_DMA0_PCI_ADDRESS_REG;
unsigned int buffer_index; unsigned int buffer_index;
...@@ -3658,24 +3658,24 @@ static int ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -3658,24 +3658,24 @@ static int ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
return 0; return 0;
} }
static int dio_callback(int dir, int port, int data, unsigned long iobase) static int dio_callback(int dir, int port, int data, void __iomem *iobase)
{ {
if (dir) { if (dir) {
writeb(data, (void *)(iobase + port)); writeb(data, iobase + port);
DEBUG_PRINT("wrote 0x%x to port %i\n", data, port); DEBUG_PRINT("wrote 0x%x to port %i\n", data, port);
return 0; return 0;
} else { } else {
return readb((void *)(iobase + port)); return readb(iobase + port);
} }
} }
static int dio_callback_4020(int dir, int port, int data, unsigned long iobase) static int dio_callback_4020(int dir, int port, int data, void __iomem *iobase)
{ {
if (dir) { if (dir) {
writew(data, (void *)(iobase + 2 * port)); writew(data, iobase + 2 * port);
return 0; return 0;
} else { } else {
return readw((void *)(iobase + 2 * port)); return readw(iobase + 2 * port);
} }
} }
...@@ -3862,7 +3862,7 @@ static uint16_t read_eeprom(struct comedi_device *dev, uint8_t address) ...@@ -3862,7 +3862,7 @@ static uint16_t read_eeprom(struct comedi_device *dev, uint8_t address)
static const int read_command = 0x6; static const int read_command = 0x6;
unsigned int bitstream = (read_command << 8) | address; unsigned int bitstream = (read_command << 8) | address;
unsigned int bit; unsigned int bit;
void *const plx_control_addr = void __iomem * const plx_control_addr =
priv(dev)->plx9080_iobase + PLX_CONTROL_REG; priv(dev)->plx9080_iobase + PLX_CONTROL_REG;
uint16_t value; uint16_t value;
static const int value_length = 16; static const int value_length = 16;
...@@ -4185,7 +4185,8 @@ static const int i2c_low_udelay = 10; ...@@ -4185,7 +4185,8 @@ static const int i2c_low_udelay = 10;
static void i2c_set_sda(struct comedi_device *dev, int state) static void i2c_set_sda(struct comedi_device *dev, int state)
{ {
static const int data_bit = CTL_EE_W; static const int data_bit = CTL_EE_W;
void *plx_control_addr = priv(dev)->plx9080_iobase + PLX_CONTROL_REG; void __iomem *plx_control_addr = priv(dev)->plx9080_iobase +
PLX_CONTROL_REG;
if (state) { if (state) {
/* set data line high */ /* set data line high */
...@@ -4204,7 +4205,8 @@ static void i2c_set_sda(struct comedi_device *dev, int state) ...@@ -4204,7 +4205,8 @@ static void i2c_set_sda(struct comedi_device *dev, int state)
static void i2c_set_scl(struct comedi_device *dev, int state) static void i2c_set_scl(struct comedi_device *dev, int state)
{ {
static const int clock_bit = CTL_USERO; static const int clock_bit = CTL_USERO;
void *plx_control_addr = priv(dev)->plx9080_iobase + PLX_CONTROL_REG; void __iomem *plx_control_addr = priv(dev)->plx9080_iobase +
PLX_CONTROL_REG;
if (state) { if (state) {
/* set clock line high */ /* set clock line high */
......
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