staging: comedi: ii_pci20kc: use comedi_dio_update_state()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 30 Aug 2013 18:10:01 +0000 (11:10 -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/ii_pci20kc.c

index 5c3a318b464012bff1f5a44c2788e20008399ed7..8577778441fa8cfa1f5af64f40f82e4cc7d0ee15 100644 (file)
@@ -378,13 +378,10 @@ static int ii20k_dio_insn_bits(struct comedi_device *dev,
                               unsigned int *data)
 {
        struct ii20k_private *devpriv = dev->private;
-       unsigned int mask = data[0] & s->io_bits;       /* outputs only */
-       unsigned int bits = data[1];
+       unsigned int mask;
 
+       mask = comedi_dio_update_state(s, data);
        if (mask) {
-               s->state &= ~mask;
-               s->state |= (bits & mask);
-
                if (mask & 0x000000ff)
                        writeb((s->state >> 0) & 0xff,
                               devpriv->ioaddr + II20K_DIO0_REG);