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

staging: comedi: das16m1: use cfc_handle_events()

Use the comedi_fc helper function to automatically call the subdevice
(*cancel) function when needed and call comedi_event().

In the Kconfig, COMEDI_DAS16M1 already selects COMEDI_FC.
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 a18fad85
...@@ -449,8 +449,8 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status) ...@@ -449,8 +449,8 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
devpriv->adc_count += num_samples; devpriv->adc_count += num_samples;
if (cmd->stop_src == TRIG_COUNT) { if (cmd->stop_src == TRIG_COUNT) {
if (devpriv->adc_count >= cmd->stop_arg * cmd->chanlist_len) { /* end of acquisition */ if (devpriv->adc_count >= cmd->stop_arg * cmd->chanlist_len) {
das16m1_cancel(dev, s); /* end of acquisition */
async->events |= COMEDI_CB_EOA; async->events |= COMEDI_CB_EOA;
} }
} }
...@@ -458,13 +458,11 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status) ...@@ -458,13 +458,11 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
/* this probably won't catch overruns since the card doesn't generate /* this probably won't catch overruns since the card doesn't generate
* overrun interrupts, but we might as well try */ * overrun interrupts, but we might as well try */
if (status & OVRUN) { if (status & OVRUN) {
das16m1_cancel(dev, s);
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR; async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
comedi_error(dev, "fifo overflow"); comedi_error(dev, "fifo overflow");
} }
comedi_event(dev, s); cfc_handle_events(dev, s);
} }
static int das16m1_poll(struct comedi_device *dev, struct comedi_subdevice *s) static int das16m1_poll(struct comedi_device *dev, struct comedi_subdevice *s)
......
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