staging: comedi: addi_apci_3120: fix apci3120_ai_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Nov 2014 17:54:33 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:34:01 +0000 (09:34 -0800)
commit89e9057b50369474c1e701faccdeedf08566ec57
tree1d6252ff29084eb7438e8391d197813ed13b2d8f
parent22f75dac46e0691ef03e44d27d21d2b860cc15fe
staging: comedi: addi_apci_3120: fix apci3120_ai_insn_read()

Now that the scanning and interrupt support have been removed from this
function it can be refactored to work correctly.

The comedi core expects (*insn_read) functions to read insn->n values
from the hardware and return the number of samples read. This function
currently just reads one sample but it returns insn->n.

Fix this function to work like the core expects.

Use comedi_timeout() to prevent a possible deadlock in the loop that
waits for the end-of-conversion.

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/addi-data/hwdrv_apci3120.c
This page took 0.024572 seconds and 5 git commands to generate.