Commit 6ea79c1d authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: s626: 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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1cc5a338
......@@ -1638,19 +1638,10 @@ static int s626_dio_insn_bits(struct comedi_device *dev,
unsigned int *data)
{
unsigned long group = (unsigned long)s->private;
unsigned long mask = data[0];
unsigned long bits = data[1];
if (mask) {
/* Check if requested channels are configured for output */
if ((s->io_bits & mask) != mask)
return -EIO;
s->state &= ~mask;
s->state |= (bits & mask);
if (comedi_dio_update_state(s, data))
DEBIwrite(dev, LP_WRDOUT(group), s->state);
}
data[1] = DEBIread(dev, LP_RDDIN(group));
return insn->n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment