diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-08-12 22:41:22 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-16 23:23:26 +0400 |
commit | f4e29703c790ee1045a0c0b7181c948b9a45636a (patch) | |
tree | 21b3260e87b8223d8cdc25d6da0fc04ade12ce72 /drivers | |
parent | ed8c80d0a4c65c062ee520cd167649b80afce16f (diff) | |
download | linux-f4e29703c790ee1045a0c0b7181c948b9a45636a.tar.xz |
staging: comedi: daqboard2000: tidy up daqboard2000_8255_cb()
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 (dioP2ExpansionIO8Bit).
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/comedi/drivers/daqboard2000.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c index d728fbd6d3a0..90fbb25e55ab 100644 --- a/drivers/staging/comedi/drivers/daqboard2000.c +++ b/drivers/staging/comedi/drivers/daqboard2000.c @@ -653,15 +653,13 @@ static void daqboard2000_initializeDac(struct comedi_device *dev) static int daqboard2000_8255_cb(struct comedi_device *dev, int dir, int port, int data, - unsigned long ioaddr) + unsigned long iobase) { - void __iomem *mmio_base = (void __iomem *)ioaddr; - if (dir) { - writew(data, mmio_base + port * 2); + writew(data, dev->mmio + iobase + port * 2); return 0; } - return readw(mmio_base + port * 2); + return readw(dev->mmio + iobase + port * 2); } static const void *daqboard2000_find_boardinfo(struct comedi_device *dev, @@ -745,7 +743,7 @@ static int daqboard2000_auto_attach(struct comedi_device *dev, s = &dev->subdevices[2]; result = subdev_8255_init(dev, s, daqboard2000_8255_cb, - (unsigned long)(dev->mmio + dioP2ExpansionIO8Bit)); + dioP2ExpansionIO8Bit); if (result) return result; |