diff options
| author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-08-12 22:41:20 +0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-16 23:23:26 +0400 |
| commit | 67393c4fef245f46863f50bc8a553f0608d7a05d (patch) | |
| tree | de6d5352a18b3cc00c361b97595696b6d31f237b | |
| parent | 09d6dd7490ee7f1dda926e309df370e28679a71c (diff) | |
| download | linux-67393c4fef245f46863f50bc8a553f0608d7a05d.tar.xz | |
staging: comedi: ni_mio_common: tidy up ni_8255_callback()
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 (Port_A).
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_mio_common.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 07659053f4d3..8b3ba40cb74c 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -4176,17 +4176,15 @@ static int ni_freq_out_insn_config(struct comedi_device *dev, return insn->n; } -static int ni_8255_callback(struct comedi_device *cdev, - int dir, int port, int data, unsigned long arg) +static int ni_8255_callback(struct comedi_device *dev, + int dir, int port, int data, unsigned long iobase) { - struct comedi_device *dev = (struct comedi_device *)arg; - if (dir) { - ni_writeb(dev, data, Port_A + 2 * port); + ni_writeb(dev, data, iobase + 2 * port); return 0; } - return ni_readb(dev, Port_A + 2 * port); + return ni_readb(dev, iobase + 2 * port); } static int ni_get_pwm_config(struct comedi_device *dev, unsigned int *data) @@ -5561,8 +5559,7 @@ static int ni_E_init(struct comedi_device *dev, /* 8255 device */ s = &dev->subdevices[NI_8255_DIO_SUBDEV]; if (board->has_8255) { - ret = subdev_8255_init(dev, s, ni_8255_callback, - (unsigned long)dev); + ret = subdev_8255_init(dev, s, ni_8255_callback, Port_A); if (ret) return ret; } else { |
