staging: comedi: addi_apci_3xxx: use comedi_dio_update_state()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 30 Aug 2013 18:09:44 +0000 (11:09 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Sep 2013 14:47:41 +0000 (07:47 -0700)
The extra mask used to only update the channels configured as outputs is
not necessary in this driver. Remove it and use comedi_dio_update_state()
to handle the boilerplate code to update the subdevice s->state.

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/addi_apci_3xxx.c

index fcec604bebf77814581bcd2a8a2a36f2061e021f..761cbf8f964b3c69b96c84baab5d9c21d7829454 100644 (file)
@@ -711,16 +711,11 @@ static int apci3xxx_dio_insn_bits(struct comedi_device *dev,
                                  struct comedi_insn *insn,
                                  unsigned int *data)
 {
-       unsigned int mask = data[0];
-       unsigned int bits = data[1];
+       unsigned int mask;
        unsigned int val;
 
-       /* only update output channels */
-       mask &= s->io_bits;
+       mask = comedi_dio_update_state(s, data);
        if (mask) {
-               s->state &= ~mask;
-               s->state |= (bits & mask);
-
                if (mask & 0xff)
                        outl(s->state & 0xff, dev->iobase + 80);
                if (mask & 0xff0000)
This page took 0.024985 seconds and 5 git commands to generate.