From a3b2ee1d3ef56d0221fc5b246368dc13cf6b8ba4 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 20 Jan 2015 12:06:01 -0700 Subject: [PATCH] staging: comedi: das16: use COMEDI_CB_CANCEL_MASK to see if command is running 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/das16.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c index 466d4ef45f3a..4608b0106b67 100644 --- a/drivers/staging/comedi/drivers/das16.c +++ b/drivers/staging/comedi/drivers/das16.c @@ -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; -- 2.30.2