staging: comedi: ni_mio_common.c: remove interrupt_pin() macros
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Jun 2014 18:10:21 +0000 (11:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 29 Jun 2014 21:17:58 +0000 (14:17 -0700)
Pass the 'interrupt_pin' to ni_E_init() and remove the macros.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_atmio.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_mio_cs.c
drivers/staging/comedi/drivers/ni_pcimio.c

index 5c6c06791b883a2a68bb013b9c4d5111080b73c6..5fe66a5ad686309f75d57ef92a874a7c0c449927 100644 (file)
@@ -264,8 +264,6 @@ static const int ni_irqpin[] = {
        -1, -1, -1, 0, 1, 2, -1, 3, -1, -1, 4, 5, 6, -1, -1, 7
 };
 
-#define interrupt_pin(a)       (ni_irqpin[(a)])
-
 #define IRQ_POLARITY 0
 
 #define NI_E_IRQ_FLAGS         0
@@ -406,7 +404,7 @@ static int ni_atmio_attach(struct comedi_device *dev,
 
        /* generic E series stuff in ni_mio_common.c */
 
-       ret = ni_E_init(dev);
+       ret = ni_E_init(dev, ni_irqpin[dev->irq]);
        if (ret < 0)
                return ret;
 
index b2d6b1d1807db9481e7375f0272e6523c2c29859..e9b9c851922afc64f27dc605859929754cc169b2 100644 (file)
@@ -5604,7 +5604,7 @@ static int ni_alloc_private(struct comedi_device *dev)
        return 0;
 }
 
-static int ni_E_init(struct comedi_device *dev)
+static int ni_E_init(struct comedi_device *dev, unsigned interrupt_pin)
 {
        const struct ni_board_struct *board = comedi_board(dev);
        struct ni_private *devpriv = dev->private;
@@ -5908,8 +5908,8 @@ static int ni_E_init(struct comedi_device *dev)
                              (IRQ_POLARITY ? Interrupt_Output_Polarity : 0) |
                              (Interrupt_Output_On_3_Pins & 0) |
                              Interrupt_A_Enable | Interrupt_B_Enable |
-                             Interrupt_A_Output_Select(interrupt_pin(dev->irq)) |
-                             Interrupt_B_Output_Select(interrupt_pin(dev->irq)),
+                             Interrupt_A_Output_Select(interrupt_pin) |
+                             Interrupt_B_Output_Select(interrupt_pin),
                              Interrupt_Control_Register);
        }
 
index ae82813070bd6b6f372674903a177fae2f8cc1f8..e61b5d1bdb41aecd92033ac8db229cca5d8d7135 100644 (file)
@@ -137,8 +137,6 @@ static const struct ni_board_struct ni_boards[] = {
 #endif
 };
 
-#define interrupt_pin(a)       0
-
 #define IRQ_POLARITY 1
 
 #include "ni_mio_common.c"
@@ -205,7 +203,7 @@ static int mio_cs_auto_attach(struct comedi_device *dev,
 
        devpriv = dev->private;
 
-       return ni_E_init(dev);
+       return ni_E_init(dev, 0);
 }
 
 static void mio_cs_detach(struct comedi_device *dev)
index faa7eb7f1d975a1e12a737601cc3711d36bb9798..fba5a9c4feb6dc682aef37dc8003f08d16a73973 100644 (file)
@@ -1042,7 +1042,6 @@ static const struct ni_board_struct ni_boards[] = {
        },
 };
 
-#define interrupt_pin(a)       0
 #define IRQ_POLARITY 1
 
 #define NI_E_IRQ_FLAGS         IRQF_SHARED
@@ -1274,7 +1273,7 @@ static int pcimio_auto_attach(struct comedi_device *dev,
                        dev->irq = irq;
        }
 
-       ret = ni_E_init(dev);
+       ret = ni_E_init(dev, 0);
        if (ret < 0)
                return ret;