]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: das16: use COMEDI_CB_CANCEL_MASK to see if command is running
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 20 Jan 2015 19:06:01 +0000 (12:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 11:59:09 +0000 (19:59 +0800)
In das16_interrupt(), use COMEDI_CB_CANCEL_MASK to determine if the async
command is still running and the dma needs to be re-enabled. This will
cause the driver not re-enable the dma if the async buffer overflows
(COMEDI_CB_OVERFLOW), a hardware error occurs (COMEDI_CB_ERROR), or the
command completes (COMEDI_CB_EOA).

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

index 466d4ef45f3ac39e8b9dac8eb5c5bb57b8f3a02c..4608b0106b67591aed2e2cdb18a9186b7dfe92c2 100644 (file)
@@ -523,7 +523,7 @@ static void das16_interrupt(struct comedi_device *dev)
        devpriv->adc_byte_count -= num_bytes;
 
        /* re-enable dma */
-       if ((async->events & COMEDI_CB_EOA) == 0) {
+       if (!(async->events & COMEDI_CB_CANCEL_MASK)) {
                struct comedi_isadma_desc *nxt_desc = &dma->desc[dma->cur_dma];
 
                nxt_desc->size = nxt_desc->maxsize;