diff options
| author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-08-30 11:09:27 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-17 07:47:41 -0700 |
| commit | a485f4d60e7de92b65e3f03ccd6c3b8cb0062c32 (patch) | |
| tree | 96da7def3eec321300e31bb167652c80515e3ae0 | |
| parent | 2da43beab0534f5c0d36e05d84659b8d5c825569 (diff) | |
staging: comedi: addi_apci_16xx: use comedi_dio_update_state()
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>
| -rw-r--r-- | drivers/staging/comedi/drivers/addi_apci_16xx.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_16xx.c b/drivers/staging/comedi/drivers/addi_apci_16xx.c index 96523744b8de..5ee204bcbeef 100644 --- a/drivers/staging/comedi/drivers/addi_apci_16xx.c +++ b/drivers/staging/comedi/drivers/addi_apci_16xx.c @@ -87,17 +87,8 @@ static int apci16xx_dio_insn_bits(struct comedi_device *dev, struct comedi_insn *insn, unsigned int *data) { - unsigned int mask = data[0]; - unsigned int bits = data[1]; - - /* Only update the channels configured as outputs */ - mask &= s->io_bits; - if (mask) { - s->state &= ~mask; - s->state |= (bits & mask); - + if (comedi_dio_update_state(s, data)) outl(s->state, dev->iobase + APCI16XX_OUT_REG(s->index)); - } data[1] = inl(dev->iobase + APCI16XX_IN_REG(s->index)); |
