aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/adl_pci7x3x.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-08-30 11:05:58 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 07:47:40 -0700
commit97f4289ad08cffe55de06d4ac4f89ac540450aee (patch)
tree9aac1e13dd79ecc23b38d6955f80bdcf68b020df /drivers/staging/comedi/drivers/adl_pci7x3x.c
parentstaging: comedi: usbdux drivers: use comedi_dio_update_state() (diff)
downloadlinux-dev-97f4289ad08cffe55de06d4ac4f89ac540450aee.tar.xz
linux-dev-97f4289ad08cffe55de06d4ac4f89ac540450aee.zip
staging: comedi: drivers: use comedi_dio_update_state() for simple cases
Use comedi_dio_update_state() to handle the boilerplate code to update the subdevice s->state for simple cases where the hardware is updated when any channel is modified. Also, fix a bug in the amplc_pc263 and amplc_pci263 drivers where the current state is not returned in data[1]. 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>
Diffstat (limited to 'drivers/staging/comedi/drivers/adl_pci7x3x.c')
-rw-r--r--drivers/staging/comedi/drivers/adl_pci7x3x.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci7x3x.c b/drivers/staging/comedi/drivers/adl_pci7x3x.c
index 81b7203f824f..5617f5ca384a 100644
--- a/drivers/staging/comedi/drivers/adl_pci7x3x.c
+++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c
@@ -112,21 +112,10 @@ static int adl_pci7x3x_do_insn_bits(struct comedi_device *dev,
unsigned int *data)
{
unsigned long reg = (unsigned long)s->private;
- unsigned int mask = data[0];
- unsigned int bits = data[1];
-
- if (mask) {
- s->state &= ~mask;
- s->state |= (bits & mask);
+ if (comedi_dio_update_state(s, data))
outl(s->state, dev->iobase + reg);
- }
- /*
- * NOTE: The output register is not readable.
- * This returned state will not be correct until all the
- * outputs have been updated.
- */
data[1] = s->state;
return insn->n;