[PATCH 20/36] staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Interrupt_Enable_Reg()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The "Interrupt Enable" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/ni_tio.c          |  2 +-
 drivers/staging/comedi/drivers/ni_tio_internal.h | 16 +---------------
 drivers/staging/comedi/drivers/ni_tiocmd.c       |  4 ++--
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c
index 633c20a..ed55885 100644
--- a/drivers/staging/comedi/drivers/ni_tio.c
+++ b/drivers/staging/comedi/drivers/ni_tio.c
@@ -416,7 +416,7 @@ void ni_tio_init_counter(struct ni_gpct *counter)
 			NITIO_DMA_CFG_REG(counter->counter_index), ~0,
 			0x0);
 	ni_tio_set_bits(counter,
-			NITIO_Gi_Interrupt_Enable_Reg(counter->counter_index),
+			NITIO_INT_ENA_REG(counter->counter_index),
 			~0, 0x0);
 }
 EXPORT_SYMBOL_GPL(ni_tio_init_counter);
diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h b/drivers/staging/comedi/drivers/ni_tio_internal.h
index 5bd0689..4382f10 100644
--- a/drivers/staging/comedi/drivers/ni_tio_internal.h
+++ b/drivers/staging/comedi/drivers/ni_tio_internal.h
@@ -39,21 +39,7 @@
 #define NITIO_ABZ_REG(x)		(NITIO_G0_ABZ + (x))
 #define NITIO_INT_ACK_REG(x)		(NITIO_G0_INT_ACK + (x))
 #define NITIO_STATUS_REG(x)		(NITIO_G0_STATUS + (x))
-
-static inline enum ni_gpct_register NITIO_Gi_Interrupt_Enable_Reg(unsigned idx)
-{
-	switch (idx) {
-	case 0:
-		return NITIO_G0_INT_ENA;
-	case 1:
-		return NITIO_G1_INT_ENA;
-	case 2:
-		return NITIO_G2_INT_ENA;
-	case 3:
-		return NITIO_G3_INT_ENA;
-	}
-	return 0;
-}
+#define NITIO_INT_ENA_REG(x)		(NITIO_G0_INT_ENA + (x))
 
 enum Gi_Auto_Increment_Reg_Bits {
 	Gi_Auto_Increment_Mask = 0xff
diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c
index e7cff8d..290fd07 100644
--- a/drivers/staging/comedi/drivers/ni_tiocmd.c
+++ b/drivers/staging/comedi/drivers/ni_tiocmd.c
@@ -200,7 +200,7 @@ static int ni_tio_cmd_setup(struct ni_gpct *counter, struct comedi_async *async)
 		retval = ni_tio_set_gate_src(counter, 0, gate_source);
 	if (cmd->flags & TRIG_WAKE_EOS) {
 		ni_tio_set_bits(counter,
-				NITIO_Gi_Interrupt_Enable_Reg(counter->
+				NITIO_INT_ENA_REG(counter->
 							      counter_index),
 				Gi_Gate_Interrupt_Enable_Bit(counter->
 							     counter_index),
@@ -311,7 +311,7 @@ int ni_tio_cancel(struct ni_gpct *counter)
 	ni_tio_configure_dma(counter, 0, 0);
 
 	ni_tio_set_bits(counter,
-			NITIO_Gi_Interrupt_Enable_Reg(counter->counter_index),
+			NITIO_INT_ENA_REG(counter->counter_index),
 			Gi_Gate_Interrupt_Enable_Bit(counter->counter_index),
 			0x0);
 	return 0;
-- 
1.8.5.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux