Commit ff6f21a5 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: hwdrv_apci3120: use comedi_handle_events()

Use comedi_handle_events() to automatically (*cancel) the async command
for an end-of-acquisition or if an error/overflow occurs.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ae4ac0db
...@@ -1329,15 +1329,14 @@ static void apci3120_interrupt_dma(int irq, void *d) ...@@ -1329,15 +1329,14 @@ static void apci3120_interrupt_dma(int irq, void *d)
if (!(cmd->flags & CMDF_WAKE_EOS)) { if (!(cmd->flags & CMDF_WAKE_EOS)) {
s->async->events |= COMEDI_CB_EOS; s->async->events |= COMEDI_CB_EOS;
comedi_event(dev, s); comedi_handle_events(dev, s);
} }
} }
if (cmd->stop_src == TRIG_COUNT) if (cmd->stop_src == TRIG_COUNT)
if (devpriv->ui_AiActualScan >= cmd->stop_arg) { if (devpriv->ui_AiActualScan >= cmd->stop_arg) {
/* all data sampled */ /* all data sampled */
apci3120_cancel(dev, s);
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
comedi_event(dev, s); comedi_handle_events(dev, s);
return; return;
} }
...@@ -1416,7 +1415,7 @@ static int apci3120_interrupt_handle_eos(struct comedi_device *dev) ...@@ -1416,7 +1415,7 @@ static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
if (err == 0) if (err == 0)
s->async->events |= COMEDI_CB_OVERFLOW; s->async->events |= COMEDI_CB_OVERFLOW;
comedi_event(dev, s); comedi_handle_events(dev, s);
return 0; return 0;
} }
...@@ -1539,12 +1538,8 @@ static void apci3120_interrupt(int irq, void *d) ...@@ -1539,12 +1538,8 @@ static void apci3120_interrupt(int irq, void *d)
outw(devpriv->us_OutputRegister, outw(devpriv->us_OutputRegister,
dev->iobase + APCI3120_WR_ADDRESS); dev->iobase + APCI3120_WR_ADDRESS);
/* stop timer 0 and timer 1 */
apci3120_cancel(dev, s);
/* UPDATE-0.7.57->0.7.68comedi_done(dev,s); */
s->async->events |= COMEDI_CB_EOA; s->async->events |= COMEDI_CB_EOA;
comedi_event(dev, s); comedi_handle_events(dev, s);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment