]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit6c7805c0fee0109f23bba9012b48d73e57238838
tree5a1d862453407488b7a5fb036f02c7dfc8cb4aff
parentf24cee4840af0ac760cf6800f82886a0f2bc033e
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