staging: comedi: addi_apci_3120: flip 'us_UseDma' test in apci3120_cyclic_ai()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Nov 2014 17:54:48 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:34:02 +0000 (09:34 -0800)
For aesthetics, flip this test and do the DMA setup first.

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

index 4760200ca1e0065cd087cade6045432c441b71af..31ef047b6281969877fe5b5e7ae63c7395419143 100644 (file)
@@ -434,8 +434,10 @@ static int apci3120_cyclic_ai(int mode,
 
        outb(devpriv->mode, dev->iobase + APCI3120_MODE_REG);
 
-       /*  If DMA is disabled */
-       if (!devpriv->us_UseDma) {
+       if (devpriv->us_UseDma) {
+               devpriv->b_InterruptMode = APCI3120_DMA_MODE;
+               apci3120_setup_dma(dev, s);
+       } else {
                /*  disable EOC and enable EOS */
                devpriv->b_InterruptMode = APCI3120_EOS_MODE;
 
@@ -461,9 +463,6 @@ static int apci3120_cyclic_ai(int mode,
                        devpriv->b_Timer2Mode = APCI3120_COUNTER;
                        devpriv->b_Timer2Interrupt = 1;
                }
-       } else {
-               devpriv->b_InterruptMode = APCI3120_DMA_MODE;
-               apci3120_setup_dma(dev, s);
        }
 
        if (!devpriv->us_UseDma && cmd->stop_src == TRIG_COUNT)