staging: comedi: dt282x: fix dt282x_ao_insn_write()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Jun 2014 20:12:39 +0000 (13:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2014 00:08:18 +0000 (20:08 -0400)
commit804ee9ac04c01946c5ba158b5e350b40ee515fed
tree5a1d862453407488b7a5fb036f02c7dfc8cb4aff
parent58c8c47fda4aa37ec946ff7ad1a42b875b03da74
staging: comedi: dt282x: fix dt282x_ao_insn_write()

The (*insn_write) functions are expected to write 'insn->n' samples to the
hardware. Fix this function so it works like the comedi core expects.

The comedi core sanity checks that the samples are within the 'maxdata' range
of the subdevice before calling the (*insn_write) so this function does not
need to mask each sample by 's->maxdata'.

Also, the wrong '*2scomp' flag in the private data was being checked to see
if the sample needs to be munged before being written. Fix this.

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/dt282x.c