]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: ni_mio_common: tidy up ni_8255_callback()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 12 Aug 2014 18:41:20 +0000 (11:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Aug 2014 19:23:26 +0000 (12:23 -0700)
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>
drivers/staging/comedi/drivers/ni_mio_common.c

index 07659053f4d3634dfe3e777e6112066dd0fb94ba..8b3ba40cb74ca0b302bfaf823aaac427e07b401b 100644 (file)
@@ -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 {