]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: me_daq: fix me_ai_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 7 Oct 2015 00:23:44 +0000 (17:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 05:56:26 +0000 (22:56 -0700)
commit4efbb2982976d46977735b5a0516f39096fadba5
treea11a010ee598a92b890579695512974bff02d812
parent2369d775bf6a5b5af2a6f71dff79085a53e9d759
staging: comedi: me_daq: fix me_ai_insn_read()

The comedi core expects (*insn_read) functions to return insn->n data
values. Refactor the function to work like the core expects. For
aesthetics, use the comedi_offset_munge() helper to munge the 2's
complement data.

This also fixes a minor issue when comedi_timeout() times out. Currently
this function just returns which leaves the ADC mode programmed for
software triggering. With the refactor the ADC mode is always disabled
when the function exits. This allows removing the unnecessary steps to
"stop any running conversions" at the start of the function.

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