staging: comedi: addi_apci_3501: absorb v_APCI3501_Interrupt()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 23 Jan 2013 19:38:44 +0000 (12:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2013 20:00:28 +0000 (12:00 -0800)
This driver only has one 'interrupt' function. Absorb the
v_APCI3501_Interrupt() function from hwdrv_apci3501.c into
the driver.

Rename v_ADDI_Interrupt() to apci3501_interrupt() so that the
function has namespace associated with the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c
drivers/staging/comedi/drivers/addi_apci_3501.c

index 733c7933f79f3983654e94ebdb56453729f4f325..74b6eacf5e932c6e0cd9b32b98390878b1d8a50e 100644 (file)
@@ -467,59 +467,3 @@ static int i_APCI3501_ReadTimerCounterWatchdog(struct comedi_device *dev,
        }
        return insn->n;
 }
-
-/*
-+----------------------------------------------------------------------------+
-| Function   Name   : static void v_APCI3501_Interrupt                                      |
-|                                        (int irq , void *d)      |
-+----------------------------------------------------------------------------+
-| Task              : Interrupt processing Routine                           |
-+----------------------------------------------------------------------------+
-| 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_APCI3501_Interrupt(int irq, void *d)
-{
-       int i_temp;
-       struct comedi_device *dev = d;
-       struct addi_private *devpriv = dev->private;
-       unsigned int ui_Timer_AOWatchdog;
-       unsigned long ul_Command1;
-
-       /*  Disable Interrupt */
-       ul_Command1 =
-               inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
-
-       ul_Command1 = (ul_Command1 & 0xFFFFF9FDul);
-       outl(ul_Command1,
-               devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
-
-       ui_Timer_AOWatchdog =
-               inl(devpriv->iobase + APCI3501_WATCHDOG +
-               APCI3501_TCW_IRQ) & 0x1;
-
-       if ((!ui_Timer_AOWatchdog)) {
-               comedi_error(dev, "IRQ from unknown source");
-               return;
-       }
-
-/*
-* Enable Interrupt Send a signal to from kernel to user space
-*/
-       send_sig(SIGIO, devpriv->tsk_Current, 0);
-       ul_Command1 =
-               inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
-       ul_Command1 = ((ul_Command1 & 0xFFFFF9FDul) | 1 << 1);
-       outl(ul_Command1,
-               devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
-       i_temp = inl(devpriv->iobase + APCI3501_WATCHDOG +
-               APCI3501_TCW_TRIG_STATUS) & 0x1;
-       return;
-}
index d6a96bd0f1d7b151c6de70d9b55686973fb6d3d4..3c82596790d5b77a31a0a08d55f62bbd1ceb6b32 100644 (file)
@@ -18,7 +18,6 @@ static const struct addi_board apci3501_boardtypes[] = {
                .pc_EepromChip          = ADDIDATA_S5933,
                .i_AoMaxdata            = 16383,
                .pr_AoRangelist         = &range_apci3501_ao,
-               .interrupt              = v_APCI3501_Interrupt,
                .ao_config              = i_APCI3501_ConfigAnalogOutput,
                .ao_write               = i_APCI3501_WriteAnalogOutput,
        },
@@ -75,13 +74,42 @@ static int i_ADDIDATA_InsnReadEeprom(struct comedi_device *dev,
        return insn->n;
 }
 
-static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
+static irqreturn_t apci3501_interrupt(int irq, void *d)
 {
        struct comedi_device *dev = d;
-       const struct addi_board *this_board = comedi_board(dev);
+       struct addi_private *devpriv = dev->private;
+       unsigned int ui_Timer_AOWatchdog;
+       unsigned long ul_Command1;
+       int i_temp;
+
+       /*  Disable Interrupt */
+       ul_Command1 =
+               inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
+
+       ul_Command1 = (ul_Command1 & 0xFFFFF9FDul);
+       outl(ul_Command1,
+               devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
+
+       ui_Timer_AOWatchdog =
+               inl(devpriv->iobase + APCI3501_WATCHDOG +
+               APCI3501_TCW_IRQ) & 0x1;
+
+       if ((!ui_Timer_AOWatchdog)) {
+               comedi_error(dev, "IRQ from unknown source");
+               return IRQ_NONE;
+       }
 
-       this_board->interrupt(irq, d);
-       return IRQ_RETVAL(1);
+       /* Enable Interrupt Send a signal to from kernel to user space */
+       send_sig(SIGIO, devpriv->tsk_Current, 0);
+       ul_Command1 =
+               inl(devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
+       ul_Command1 = ((ul_Command1 & 0xFFFFF9FDul) | 1 << 1);
+       outl(ul_Command1,
+               devpriv->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG);
+       i_temp = inl(devpriv->iobase + APCI3501_WATCHDOG +
+               APCI3501_TCW_TRIG_STATUS) & 0x1;
+
+       return IRQ_HANDLED;
 }
 
 static int apci3501_reset(struct comedi_device *dev)
@@ -190,7 +218,7 @@ static int apci3501_auto_attach(struct comedi_device *dev,
        /* ## */
 
        if (pcidev->irq > 0) {
-               ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
+               ret = request_irq(pcidev->irq, apci3501_interrupt, IRQF_SHARED,
                                  dev->board_name, dev);
                if (ret == 0)
                        dev->irq = pcidev->irq;