Currently cfc_handle_events() is done by both the DMA and non-DMA helper
functions that are called by the interrupt handler. For aesthetics, move
the cfc_handle_events() to the end of the interrupt handler do it in one
place.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c 
b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
index 0a11340..01db68b 100644
--- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
+++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c
@@ -1327,16 +1327,13 @@ static void apci3120_interrupt_dma(int irq, void *d)
                        devpriv->ul_DmaBufferVirtual[devpriv->
                                ui_DmaActualBuffer], samplesinbuf);
 
-               if (!(cmd->flags & CMDF_WAKE_EOS)) {
+               if (!(cmd->flags & CMDF_WAKE_EOS))
                        s->async->events |= COMEDI_CB_EOS;
-                       cfc_handle_events(dev, s);
-               }
        }
        if (cmd->stop_src == TRIG_COUNT)
                if (devpriv->ui_AiActualScan >= cmd->stop_arg) {
                        /*  all data sampled */
                        s->async->events |= COMEDI_CB_EOA;
-                       cfc_handle_events(dev, s);
                        return;
                }
 
@@ -1415,8 +1412,6 @@ static int apci3120_interrupt_handle_eos(struct 
comedi_device *dev)
        if (err == 0)
                s->async->events |= COMEDI_CB_OVERFLOW;
 
-       cfc_handle_events(dev, s);
-
        return 0;
 }
 
@@ -1539,8 +1534,6 @@ static void apci3120_interrupt(int irq, void *d)
                                dev->iobase + APCI3120_WR_ADDRESS);
 
                        s->async->events |= COMEDI_CB_EOA;
-                       cfc_handle_events(dev, s);
-
                        break;
 
                case APCI3120_TIMER:
@@ -1593,6 +1586,7 @@ static void apci3120_interrupt(int irq, void *d)
                }
 
        }
+       cfc_handle_events(dev, s);
 }
 
 /*
-- 
2.0.3

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to