staging: comedi: quatech_daqp_cs: use cfc_handle_events()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Sat, 8 Mar 2014 00:31:45 +0000 (17:31 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Mar 2014 20:55:57 +0000 (13:55 -0700)
Use the comedi_fc helper function to automatically call the subdevice
(*cancel) function when needed and call comedi_event().

Update the Kconfig so that COMEDI_QUATECH_DAQP_CS 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/Kconfig
drivers/staging/comedi/drivers/quatech_daqp_cs.c

index 279364a7dc9e5a83a49b697ca4b3884596ce0e49..1a7e8e17e03e4716a175014b5a29c0e9cff9bad2 100644 (file)
@@ -1185,6 +1185,7 @@ config COMEDI_NI_MIO_CS
 
 config COMEDI_QUATECH_DAQP_CS
        tristate "Quatech DAQP PCMCIA data capture card support"
+       select COMEDI_FC
        ---help---
          Enable support for the Quatech DAQP PCMCIA data capture cards
          DAQP-208 and DAQP-308
index 96a46954b3c09819184474a82615962a9120146d..298dba03f9026b60cd37b8a144e727461b8292aa 100644 (file)
@@ -214,7 +214,6 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                                s->async->events |=
                                    COMEDI_CB_EOA | COMEDI_CB_OVERFLOW;
                                dev_warn(dev->class_dev, "data lost\n");
-                               daqp_ai_cancel(dev, s);
                                break;
                        }
 
@@ -231,7 +230,6 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                        if (devpriv->count > 0) {
                                devpriv->count--;
                                if (devpriv->count == 0) {
-                                       daqp_ai_cancel(dev, s);
                                        s->async->events |= COMEDI_CB_EOA;
                                        break;
                                }
@@ -244,13 +242,12 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                if (loop_limit <= 0) {
                        dev_warn(dev->class_dev,
                                 "loop_limit reached in daqp_interrupt()\n");
-                       daqp_ai_cancel(dev, s);
                        s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
                }
 
                s->async->events |= COMEDI_CB_BLOCK;
 
-               comedi_event(dev, s);
+               cfc_handle_events(dev, s);
        }
        return IRQ_HANDLED;
 }