]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: addi_apci_3120: remove private data 'ai_running'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Nov 2014 17:54:39 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:34:01 +0000 (09:34 -0800)
This member of the private data was used to determine if the interrupt
routine was handling data for the (*insn_read) or an async command. Now
that the (*insn_read) does not use interrupts this member is not needed.

Remove the member and refactor the code.

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/addi-data/hwdrv_apci3120.c
drivers/staging/comedi/drivers/addi_apci_3120.c

index 83881a61dbe064f68a15f751f1615fbc6c14a2d3..7bd17c28ebae52d25a4652f8276ff8cfa54b446e 100644 (file)
@@ -195,7 +195,6 @@ static int apci3120_reset(struct comedi_device *dev)
 {
        struct apci3120_private *devpriv = dev->private;
 
-       devpriv->ai_running = 0;
        devpriv->b_InterruptMode = APCI3120_EOC_MODE;
 
        /*  variables used in timer subdevice */
@@ -246,7 +245,6 @@ static int apci3120_cancel(struct comedi_device *dev,
        inw(dev->iobase + APCI3120_STATUS_REG);
        devpriv->ui_DmaActualBuffer = 0;
 
-       devpriv->ai_running = 0;
        devpriv->b_InterruptMode = APCI3120_EOC_MODE;
 
        return 0;
@@ -338,8 +336,6 @@ static int apci3120_cyclic_ai(int mode,
        unsigned int dmalen1 = 0;
        unsigned int divisor0;
 
-       devpriv->ai_running = 1;
-
        /*  clear software  registers */
        devpriv->timer_mode = 0;
        devpriv->mode = 0;
@@ -775,18 +771,16 @@ static irqreturn_t apci3120_interrupt(int irq, void *d)
 
        if ((status & APCI3120_STATUS_EOS_INT) &&
            devpriv->b_InterruptMode == APCI3120_EOS_MODE) {
-               if (devpriv->ai_running) {
-                       unsigned short val;
-                       int i;
-
-                       for (i = 0; i < cmd->chanlist_len; i++) {
-                               val = inw(dev->iobase + 0);
-                               comedi_buf_write_samples(s, &val, 1);
-                       }
+               unsigned short val;
+               int i;
 
-                       devpriv->mode |= APCI3120_MODE_EOS_IRQ_ENA;
-                       outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG);
+               for (i = 0; i < cmd->chanlist_len; i++) {
+                       val = inw(dev->iobase + 0);
+                       comedi_buf_write_samples(s, &val, 1);
                }
+
+               devpriv->mode |= APCI3120_MODE_EOS_IRQ_ENA;
+               outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG);
        }
 
        if (status & APCI3120_STATUS_TIMER2_INT) {
@@ -821,21 +815,14 @@ static irqreturn_t apci3120_interrupt(int irq, void *d)
 
        if ((status & APCI3120_STATUS_AMCC_INT) &&
            devpriv->b_InterruptMode == APCI3120_DMA_MODE) {
-               if (devpriv->ai_running) {
+               /* Clear Timer Write TC int */
+               outl(APCI3120_CLEAR_WRITE_TC_INT,
+                       devpriv->amcc + APCI3120_AMCC_OP_REG_INTCSR);
 
-                       /* Clear Timer Write TC int */
-                       outl(APCI3120_CLEAR_WRITE_TC_INT,
-                            devpriv->amcc + APCI3120_AMCC_OP_REG_INTCSR);
-
-                       apci3120_clr_timer2_interrupt(dev);
-
-                       /* do some data transfer */
-                       apci3120_interrupt_dma(irq, d);
-               } else {
-                       apci3120_timer_enable(dev, 0, false);
-                       apci3120_timer_enable(dev, 1, false);
-               }
+               apci3120_clr_timer2_interrupt(dev);
 
+               /* do some data transfer */
+               apci3120_interrupt_dma(irq, d);
        }
        comedi_handle_events(dev, s);
 
index c18ee175023724ed6db9bdb4b3cb786b02bbfe7a..98de447d96b7f66c7532cba100aafc246d186c53 100644 (file)
@@ -133,7 +133,6 @@ struct apci3120_private {
        unsigned short ctrl;
        unsigned char b_Timer2Mode;
        unsigned char b_Timer2Interrupt;
-       unsigned int ai_running:1;
        unsigned char b_InterruptMode;
        unsigned char b_ExttrigEnable;
        struct task_struct *tsk_Current;