staging: comedi: drivers: use comedi_dio_update_state() for simple cases
commit 97f4289ad0 upstream.
[Split from original patch subject: "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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bc049656c2
commit
442ae1bbb7
2 changed files with 6 additions and 0 deletions
|
|
@ -72,6 +72,9 @@ static int pc263_do_insn_bits(struct comedi_device *dev,
|
|||
outb(s->state & 0xFF, dev->iobase);
|
||||
outb(s->state >> 8, dev->iobase + 1);
|
||||
}
|
||||
|
||||
data[1] = s->state;
|
||||
|
||||
return insn->n;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ static int pci263_do_insn_bits(struct comedi_device *dev,
|
|||
outb(s->state & 0xFF, dev->iobase);
|
||||
outb(s->state >> 8, dev->iobase + 1);
|
||||
}
|
||||
|
||||
data[1] = s->state;
|
||||
|
||||
return insn->n;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue