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

staging: comedi: addi_apci_3120: absorb apci3120_interrupt_handle_eos()



Absorb this simple function into apci3120_interrupt().

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 89e9057b
Loading
Loading
Loading
Loading
+8 −20
Original line number Diff line number Diff line
@@ -747,25 +747,6 @@ static void apci3120_interrupt_dma(int irq, void *d)
	}
}

/*
 * This function handles EOS interrupt.
 * This function copies the acquired data(from FIFO) to Comedi buffer.
 */
static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
{
	struct apci3120_private *devpriv = dev->private;
	struct comedi_subdevice *s = dev->read_subdev;
	unsigned short val;
	int i;

	for (i = 0; i < devpriv->ui_AiNbrofChannels; i++) {
		val = inw(dev->iobase + 0);
		comedi_buf_write_samples(s, &val, 1);
	}

	return 0;
}

static irqreturn_t apci3120_interrupt(int irq, void *d)
{
	struct comedi_device *dev = d;
@@ -807,7 +788,14 @@ static irqreturn_t apci3120_interrupt(int irq, void *d)
	/*  Check If EOS interrupt */
	if ((int_daq & 0x2) && (devpriv->b_InterruptMode == APCI3120_EOS_MODE)) {
		if (devpriv->ai_running) {
			apci3120_interrupt_handle_eos(dev);
			unsigned short val;
			int i;

			for (i = 0; i < devpriv->ui_AiNbrofChannels; 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);
		}