mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-01 16:57:18 +09:00
staging: comedi: contec_pci_dio: cleanup contec_do_insn_bits
Create local variables for the mask and bits values passed in the data pointer to make this function a bit clearer. Return the state of the output bits (s->state) in data[1] since this is what comedilib is expecting. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8d02b3aa67
commit
00d7a906cd
@@ -44,12 +44,18 @@ static int contec_do_insn_bits(struct comedi_device *dev,
|
||||
struct comedi_subdevice *s,
|
||||
struct comedi_insn *insn, unsigned int *data)
|
||||
{
|
||||
if (data[0]) {
|
||||
s->state &= ~data[0];
|
||||
s->state |= data[0] & data[1];
|
||||
unsigned int mask = data[0];
|
||||
unsigned int bits = data[1];
|
||||
|
||||
if (mask) {
|
||||
s->state &= ~mask;
|
||||
s->state |= (bits & mask);
|
||||
|
||||
outw(s->state, dev->iobase + PIO1616L_DO_REG);
|
||||
}
|
||||
|
||||
data[1] = s->state;
|
||||
|
||||
return insn->n;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user