OSDN Git Service

staging: comedi: das16: use comedi_async 'scans_done' to detect EOA
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 26 Jan 2015 23:17:19 +0000 (16:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jan 2015 19:14:04 +0000 (11:14 -0800)
commit42c44682a59a6ea38a301c20a4ec807c6fabdd02
tree5b414ed7f77e8042567a74124b310ab0f1df9327
parent29538110470aec8a9b0a378d10371821d8f6e27e
staging: comedi: das16: use comedi_async 'scans_done' to detect EOA

Refactor das16_interrupt() to use the comedi_async 'scans_done' member to
detect the End-of-Acquisition for the async command. Use the helper function
comedi_nsamples_left() to determine if DMA needs to be restarted.

This allows the removal of the private data 'adc_byte_count' and fixes a
possible integer overflow issue when that value is calculated.

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