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

index df7010b..2fb0cc0 100644 (file)
@@ -199,6 +199,7 @@ config COMEDI_PCL816
 config COMEDI_PCL818
        tristate "Advantech PCL-718 and PCL-818 ISA card support"
        depends on VIRT_TO_BUS && ISA_DMA_API
+       select COMEDI_FC
        ---help---
          Enable support for Advantech PCL-818 ISA cards
          PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818 and PCL-718
index d4d5c38..6463476 100644 (file)
@@ -510,7 +510,6 @@ static bool pcl818_ai_dropout(struct comedi_device *dev,
                        (devpriv->dma) ? "DMA" :
                        (devpriv->usefifo) ? "FIFO" : "IRQ",
                        chan, expected_chan);
-               s->cancel(dev, s);
                s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
                return true;
        }
@@ -538,7 +537,6 @@ static bool pcl818_ai_next_chan(struct comedi_device *dev,
 
        if (cmd->stop_src == TRIG_COUNT && devpriv->ai_act_scan == 0) {
                /* all data sampled */
-               s->cancel(dev, s);
                s->async->events |= COMEDI_CB_EOA;
                return false;
        }
@@ -554,7 +552,6 @@ static void pcl818_handle_eoc(struct comedi_device *dev,
 
        if (pcl818_ai_eoc(dev, s, NULL, 0)) {
                comedi_error(dev, "A/D mode1/3 IRQ without DRDY!");
-               s->cancel(dev, s);
                s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
                return;
        }
@@ -612,14 +609,12 @@ static void pcl818_handle_fifo(struct comedi_device *dev,
 
        if (status & 4) {
                comedi_error(dev, "A/D mode1/3 FIFO overflow!");
-               s->cancel(dev, s);
                s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
                return;
        }
 
        if (status & 1) {
                comedi_error(dev, "A/D mode1/3 FIFO interrupt without data!");
-               s->cancel(dev, s);
                s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
                return;
        }
@@ -674,7 +669,7 @@ static irqreturn_t pcl818_interrupt(int irq, void *d)
 
        pcl818_ai_clear_eoc(dev);
 
-       comedi_event(dev, s);
+       cfc_handle_events(dev, s);
        return IRQ_HANDLED;
 }