Commit 5c66a77e authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 76931af2
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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)