staging: comedi: ni_mio_common: fix ni_ao_insn_write()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 14 Jul 2014 19:23:43 +0000 (12:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jul 2014 20:24:42 +0000 (13:24 -0700)
commitbfb0c28ba03a46740c80848ba7b93fafb91de033
tree1891b46c4cce2bb7f3be8adc66710dddc7d795ee
parent87b4fe5c877b178949c71e017e4a129e29aae37e
staging: comedi: ni_mio_common: fix ni_ao_insn_write()

Comedi (*insn_write) functions are expected to write insn->n values
to the hardware. Fix this function to work like the core expects.

Also, don't rely on the return value of ni_ao_comfig_chanlist() to
determine if the values need converted to two's complement before
writing to the hardware. Use the comedi_range_is_bipolar() and
comedi_offset_munge() helpers to clarify the code.

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>
drivers/staging/comedi/drivers/ni_mio_common.c