From 5c66a77e1d1da92f4b42c069d6591ecc41dbe6ba Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 4 Nov 2014 10:54:48 -0700 Subject: [PATCH] staging: comedi: addi_apci_3120: flip 'us_UseDma' test in apci3120_cyclic_ai() For aesthetics, flip this test and do the DMA setup first. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../staging/comedi/drivers/addi-data/hwdrv_apci3120.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index 4760200ca1e0..31ef047b6281 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c @@ -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) -- 2.39.5