Skip to content

Commit

Permalink
staging: comedi: das16m1: use cfc_handle_events()
Browse files Browse the repository at this point in the history
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: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Mar 17, 2014
1 parent a18fad8 commit 6278c5d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/staging/comedi/drivers/das16m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,22 +449,20 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
devpriv->adc_count += num_samples;

if (cmd->stop_src == TRIG_COUNT) {
if (devpriv->adc_count >= cmd->stop_arg * cmd->chanlist_len) { /* end of acquisition */
das16m1_cancel(dev, s);
if (devpriv->adc_count >= cmd->stop_arg * cmd->chanlist_len) {
/* end of acquisition */
async->events |= COMEDI_CB_EOA;
}
}

/* this probably won't catch overruns since the card doesn't generate
* overrun interrupts, but we might as well try */
if (status & OVRUN) {
das16m1_cancel(dev, s);
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
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)
Expand Down

0 comments on commit 6278c5d

Please sign in to comment.