Skip to content

Commit 4d9b071

Browse files
bigguinessgregkh
authored andcommitted
staging: comedi: dmm32at: make AI (*cancel) actually cancel async command
Currently the AI (*cancel) changes a private data member to cause the interrupt handler to cancel the async command after the next interrupt. Move the code that disables the interrupt and terminates the acquisition from the interrunt handler into dmm32at_ai_cancel() so that the async command is terminated instantly. Signed-off-by: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b6bc224 commit 4d9b071

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/staging/comedi/drivers/dmm32at.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,8 @@ static int dmm32at_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
468468
static int dmm32at_ai_cancel(struct comedi_device *dev,
469469
struct comedi_subdevice *s)
470470
{
471-
struct dmm32at_private *devpriv = dev->private;
472-
473-
devpriv->ai_scans_left = 1;
471+
/* disable further interrupts and clocks */
472+
outb(0x0, dev->iobase + DMM32AT_INTCLOCK);
474473
return 0;
475474
}
476475

@@ -507,8 +506,6 @@ static irqreturn_t dmm32at_isr(int irq, void *d)
507506
if (devpriv->ai_scans_left != 0xffffffff) { /* TRIG_COUNT */
508507
devpriv->ai_scans_left--;
509508
if (devpriv->ai_scans_left == 0) {
510-
/* disable further interrupts and clocks */
511-
outb(0x0, dev->iobase + DMM32AT_INTCLOCK);
512509
/* set the buffer to be flushed with an EOF */
513510
s->async->events |= COMEDI_CB_EOA;
514511
}

0 commit comments

Comments
 (0)