]> Pileus Git - ~andy/linux/commitdiff
staging: comedi: addi_apci_1032: cleanup v_ADDI_Interrupt()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 5 Nov 2012 21:40:34 +0000 (14:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Nov 2012 08:30:57 +0000 (09:30 +0100)
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: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c
drivers/staging/comedi/drivers/addi_apci_1032.c

index 3e3c229dba9a465f344e224143a6583fc7b627d5..6ee5d5d6d106b09b9a428b6061be58d84fe85737 100644 (file)
@@ -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;
-}
index 1b4d6983aa54109f74ed34f64dde10ce3ec093ba..ab346719671af087d7c657cc6c928a6126c6892c 100644 (file)
@@ -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;