staging: comedi: das1800: use cfc_handle_events()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Sat, 8 Mar 2014 00:31:32 +0000 (17:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Mar 2014 20:55:54 +0000 (13:55 -0700)
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>
drivers/staging/comedi/drivers/das1800.c

index 320d95a..9f353cf 100644 (file)
@@ -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 */
@@ -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,