diff options
| author | 2014-08-12 11:41:21 -0700 | |
|---|---|---|
| committer | 2014-08-16 12:23:26 -0700 | |
| commit | ed8c80d0a4c65c062ee520cd167649b80afce16f (patch) | |
| tree | 9b94e6a4de9236f93972e058c7c2495fa386b548 | |
| parent | staging: comedi: ni_mio_common: tidy up ni_8255_callback() (diff) | |
staging: comedi: ni_labpc: tidy up labpc_8255_mmio()
The 8255 driver (*io) callback now includes the comedi_device pointer.
Instead of passing the (cast) pointer to subdev_8255_init(), pass the
'iobase' of the 8255 registers (DIO_BASE_REG).
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>
| -rw-r--r-- | drivers/staging/comedi/drivers/ni_labpc.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index fa108b9dd603..15ead2715926 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -1035,17 +1035,15 @@ static int labpc_ao_insn_read(struct comedi_device *dev, return 1; } -static int labpc_8255_mmio(struct comedi_device *cdev, - int dir, int port, int data, unsigned long arg) +static int labpc_8255_mmio(struct comedi_device *dev, + int dir, int port, int data, unsigned long iobase) { - struct comedi_device *dev = (struct comedi_device *)arg; - if (dir) { - writeb(data, dev->mmio + DIO_BASE_REG + port); + writeb(data, dev->mmio + iobase + port); return 0; } - return readb(dev->mmio + DIO_BASE_REG + port); + return readb(dev->mmio + iobase + port); } /* lowlevel write to eeprom/dac */ @@ -1405,7 +1403,7 @@ int labpc_common_attach(struct comedi_device *dev, s = &dev->subdevices[2]; if (dev->mmio) { ret = subdev_8255_init(dev, s, labpc_8255_mmio, - (unsigned long)dev); + DIO_BASE_REG); } else { ret = subdev_8255_init(dev, s, NULL, dev->iobase + DIO_BASE_REG); |
