Commit 27fdf385 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: cb_pcidas64: tidy up dio_callback()

The 8255 driver (*io) callback now includes the comedi_device pointer.
Using this we can get the ioremap'ed base address.

Instead of passing the (cast) mmio address to subdev_8255_init(), pass
the 'iobase' of the 8255 registers (DIO_8255_OFFSET).
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4e29703
...@@ -3370,15 +3370,13 @@ static int ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -3370,15 +3370,13 @@ static int ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
} }
static int dio_callback(struct comedi_device *dev, static int dio_callback(struct comedi_device *dev,
int dir, int port, int data, unsigned long arg) int dir, int port, int data, unsigned long iobase)
{ {
void __iomem *iobase = (void __iomem *)arg;
if (dir) { if (dir) {
writeb(data, iobase + port); writeb(data, dev->mmio + iobase + port);
return 0; return 0;
} }
return readb(iobase + port); return readb(dev->mmio + iobase + port);
} }
static int dio_callback_4020(struct comedi_device *dev, static int dio_callback_4020(struct comedi_device *dev,
...@@ -3846,9 +3844,8 @@ static int setup_subdevices(struct comedi_device *dev) ...@@ -3846,9 +3844,8 @@ static int setup_subdevices(struct comedi_device *dev)
ret = subdev_8255_init(dev, s, dio_callback_4020, ret = subdev_8255_init(dev, s, dio_callback_4020,
(unsigned long)dio_8255_iobase); (unsigned long)dio_8255_iobase);
} else { } else {
dio_8255_iobase = dev->mmio + DIO_8255_OFFSET;
ret = subdev_8255_init(dev, s, dio_callback, ret = subdev_8255_init(dev, s, dio_callback,
(unsigned long)dio_8255_iobase); DIO_8255_OFFSET);
} }
if (ret) if (ret)
return ret; return ret;
......
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