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

index 80767343b2d4b03fdbdff7640fc773f67af0118c..627c67b092b597d0e5261bac2e08d957d4311d53 100644 (file)
@@ -177,6 +177,7 @@ config COMEDI_PCL730
 config COMEDI_PCL812
        tristate "Advantech PCL-812/813 and ADlink ACL-8112/8113/8113/8216"
        depends on VIRT_TO_BUS && ISA_DMA_API
+       select COMEDI_FC
        ---help---
          Enable support for Advantech PCL-812/PG, PCL-813/B, ADLink
          ACL-8112DG/HG/PG, ACL-8113, ACL-8216, ICP DAS A-821PGH/PGL/PGL-NDA,
index 5436cd9dd7ba3ddae2e9d4412db9373bfc59964e..160eac8083db16fb6a5b6f8bb5eaeacfa7686a12 100644 (file)
@@ -863,7 +863,6 @@ static bool pcl812_ai_next_chan(struct comedi_device *dev,
        if (cmd->stop_src == TRIG_COUNT &&
            devpriv->ai_act_scan >= cmd->stop_arg) {
                /* all data sampled */
-               s->cancel(dev, s);
                s->async->events |= COMEDI_CB_EOA;
                return false;
        }
@@ -879,7 +878,6 @@ static void pcl812_handle_eoc(struct comedi_device *dev,
 
        if (pcl812_ai_eoc(dev, s, NULL, 0)) {
                dev_dbg(dev->class_dev, "A/D cmd IRQ without DRDY!\n");
-               s->cancel(dev, s);
                s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
                return;
        }
@@ -948,7 +946,7 @@ static irqreturn_t pcl812_interrupt(int irq, void *d)
 
        pcl812_ai_clear_eoc(dev);
 
-       comedi_event(dev, s);
+       cfc_handle_events(dev, s);
        return IRQ_HANDLED;
 }