mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
staging: comedi: rti800: tidy up rti800_do_insn_bits()
To clarify the function a bit, add local variables for the 'mask' and 'bits', passed by the comedi core, used to update the digital outputs. 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:
parent
97f67708e6
commit
bd838bea6a
1 changed files with 9 additions and 4 deletions
|
|
@ -265,11 +265,16 @@ static int rti800_di_insn_bits(struct comedi_device *dev,
|
|||
|
||||
static int rti800_do_insn_bits(struct comedi_device *dev,
|
||||
struct comedi_subdevice *s,
|
||||
struct comedi_insn *insn, unsigned int *data)
|
||||
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);
|
||||
|
||||
/* Outputs are inverted... */
|
||||
outb(s->state ^ 0xff, dev->iobase + RTI800_DO);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue