Skip to content

Commit

Permalink
staging: comedi: das1800: 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_DAS1800 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 f382898 commit c969509
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/staging/comedi/drivers/das1800.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,8 @@ static void das1800_ai_handler(struct comedi_device *dev)
/* clear OVF interrupt bit */
outb(CLEAR_INTR_MASK & ~OVF, dev->iobase + DAS1800_STATUS);
comedi_error(dev, "DAS1800 FIFO overflow");
das1800_cancel(dev, s);
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
comedi_event(dev, s);
cfc_handle_events(dev, s);
return;
}
/* stop taking data if appropriate */
Expand All @@ -680,16 +679,12 @@ static void das1800_ai_handler(struct comedi_device *dev)
das1800_flush_dma(dev, s);
else
das1800_handle_fifo_not_empty(dev, s);
das1800_cancel(dev, s); /* disable hardware conversions */
async->events |= COMEDI_CB_EOA;
} else if (cmd->stop_src == TRIG_COUNT && devpriv->count == 0) { /* stop_src TRIG_COUNT */
das1800_cancel(dev, s); /* disable hardware conversions */
async->events |= COMEDI_CB_EOA;
}

comedi_event(dev, s);

return;
cfc_handle_events(dev, s);
}

static int das1800_ai_poll(struct comedi_device *dev,
Expand Down

0 comments on commit c969509

Please sign in to comment.