Commit 12d606f7 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: addi_apci_1032: cleanup v_ADDI_Interrupt()

There is no need for this function to call v_APCI1032_Interrupt()
in hwdrv_apci1032.c to reset the board. Just move the code from
v_APCI1032_Interrupt() directly into this function.

Rename the CamelCase function to apci1032_interrupt().

Rename the CamelCase local variable used to read/write the control
register.

Change the return from IRQ_RETVAL(1) to IRQ_HANDLED.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b37f84d5
......@@ -135,38 +135,3 @@ static int i_APCI1032_ConfigDigitalInput(struct comedi_device *dev,
return insn->n;
}
/*
+----------------------------------------------------------------------------+
| Function Name : static void v_APCI1032_Interrupt |
| (int irq , void *d) |
+----------------------------------------------------------------------------+
| Task : Interrupt handler for the interruptible digital inputs |
+----------------------------------------------------------------------------+
| Input Parameters : int irq : irq number |
| void *d : void pointer |
+----------------------------------------------------------------------------+
| Output Parameters : -- |
+----------------------------------------------------------------------------+
| Return Value : TRUE : No error occur |
| : FALSE : Error occur. Return the error |
| |
+----------------------------------------------------------------------------+
*/
static void v_APCI1032_Interrupt(int irq, void *d)
{
struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private;
unsigned int ui_Temp;
/* disable the interrupt */
ui_Temp = inl(dev->iobase + APCI1032_CTRL_REG);
outl(ui_Temp & ~APCI1032_CTRL_INT_ENA,
dev->iobase + APCI1032_CTRL_REG);
ui_InterruptStatus = inl(dev->iobase + APCI1032_STATUS_REG);
ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
/* enable the interrupt */
outl(ui_Temp, dev->iobase + APCI1032_CTRL_REG);
return;
}
......@@ -6,10 +6,24 @@
#include "addi-data/hwdrv_apci1032.c"
static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
static irqreturn_t apci1032_interrupt(int irq, void *d)
{
v_APCI1032_Interrupt(irq, d);
return IRQ_RETVAL(1);
struct comedi_device *dev = d;
struct addi_private *devpriv = dev->private;
unsigned int ctrl;
/* disable the interrupt */
ctrl = inl(dev->iobase + APCI1032_CTRL_REG);
outl(ctrl & ~APCI1032_CTRL_INT_ENA, dev->iobase + APCI1032_CTRL_REG);
ui_InterruptStatus = inl(dev->iobase + APCI1032_STATUS_REG);
ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
/* enable the interrupt */
outl(ctrl, dev->iobase + APCI1032_CTRL_REG);
return IRQ_HANDLED;
}
static int apci1032_di_insn_bits(struct comedi_device *dev,
......@@ -56,7 +70,7 @@ static int apci1032_attach_pci(struct comedi_device *dev,
dev->iobase = pci_resource_start(pcidev, 2);
if (pcidev->irq > 0) {
ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
ret = request_irq(pcidev->irq, apci1032_interrupt, IRQF_SHARED,
dev->board_name, dev);
if (ret == 0)
dev->irq = pcidev->irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment