From 1fa955ba355bfa6eb83b8fd9cc6064a561291d1f Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 20 Jun 2014 11:10:23 -0700 Subject: [PATCH] staging: comedi: ni_mio_common.c: remove IRQ_POLARITY defines Pass the irq_polarity to ni_E_init() and remove the defines. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_atmio.c | 4 +--- drivers/staging/comedi/drivers/ni_mio_common.c | 5 +++-- drivers/staging/comedi/drivers/ni_mio_cs.c | 4 +--- drivers/staging/comedi/drivers/ni_pcimio.c | 4 +--- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c index a5c7ceaa771f..761a8329bf36 100644 --- a/drivers/staging/comedi/drivers/ni_atmio.c +++ b/drivers/staging/comedi/drivers/ni_atmio.c @@ -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 IRQ_POLARITY 0 - #include "ni_mio_common.c" static struct pnp_device_id device_ids[] = { @@ -402,7 +400,7 @@ static int ni_atmio_attach(struct comedi_device *dev, /* generic E series stuff in ni_mio_common.c */ - ret = ni_E_init(dev, ni_irqpin[dev->irq]); + ret = ni_E_init(dev, ni_irqpin[dev->irq], 0); if (ret < 0) return ret; diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index e9b9c851922a..ff881a7afdd3 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -5604,7 +5604,8 @@ static int ni_alloc_private(struct comedi_device *dev) return 0; } -static int ni_E_init(struct comedi_device *dev, unsigned interrupt_pin) +static int ni_E_init(struct comedi_device *dev, + unsigned interrupt_pin, unsigned irq_polarity) { const struct ni_board_struct *board = comedi_board(dev); struct ni_private *devpriv = dev->private; @@ -5905,7 +5906,7 @@ static int ni_E_init(struct comedi_device *dev, unsigned interrupt_pin) if (dev->irq) { ni_stc_writew(dev, - (IRQ_POLARITY ? Interrupt_Output_Polarity : 0) | + (irq_polarity ? Interrupt_Output_Polarity : 0) | (Interrupt_Output_On_3_Pins & 0) | Interrupt_A_Enable | Interrupt_B_Enable | Interrupt_A_Output_Select(interrupt_pin) | diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c index e61b5d1bdb41..fe6d3943bbee 100644 --- a/drivers/staging/comedi/drivers/ni_mio_cs.c +++ b/drivers/staging/comedi/drivers/ni_mio_cs.c @@ -137,8 +137,6 @@ static const struct ni_board_struct ni_boards[] = { #endif }; -#define IRQ_POLARITY 1 - #include "ni_mio_common.c" static const void *ni_getboardtype(struct comedi_device *dev, @@ -203,7 +201,7 @@ static int mio_cs_auto_attach(struct comedi_device *dev, devpriv = dev->private; - return ni_E_init(dev, 0); + return ni_E_init(dev, 0, 1); } static void mio_cs_detach(struct comedi_device *dev) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index 07b70270ac79..a846b88351f6 100644 --- a/drivers/staging/comedi/drivers/ni_pcimio.c +++ b/drivers/staging/comedi/drivers/ni_pcimio.c @@ -1042,8 +1042,6 @@ static const struct ni_board_struct ni_boards[] = { }, }; -#define IRQ_POLARITY 1 - #include "ni_mio_common.c" static int pcimio_ai_change(struct comedi_device *dev, @@ -1271,7 +1269,7 @@ static int pcimio_auto_attach(struct comedi_device *dev, dev->irq = irq; } - ret = ni_E_init(dev, 0); + ret = ni_E_init(dev, 0, 1); if (ret < 0) return ret; -- 2.39.5