diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-12-20 03:31:51 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-20 23:49:32 +0400 |
commit | c9d766d04ab032943c0fa68ddc6434ca1fe2c9f8 (patch) | |
tree | 09aeeed5856c869b27563bd87aa6aaa36d24d13a | |
parent | e72ccb041bc1d068ae216c7fa6513d70c075d440 (diff) | |
download | linux-c9d766d04ab032943c0fa68ddc6434ca1fe2c9f8.tar.xz |
staging: comedi: ni_tio_internal.h: replace NITIO_Gi_Status_Reg()
The "Status" registers are sequential in the enum ni_gpct_register.
Replace this inline CamelCase function with a simple define.
Rename the define for the shared status register.
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>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_tio.c | 4 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_tio_internal.h | 18 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/ni_tiocmd.c | 4 |
3 files changed, 6 insertions, 20 deletions
diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c index 8762dc628c27..633c20af484a 100644 --- a/drivers/staging/comedi/drivers/ni_tio.c +++ b/drivers/staging/comedi/drivers/ni_tio.c @@ -425,7 +425,7 @@ static unsigned int ni_tio_counter_status(struct ni_gpct *counter) { unsigned int status = 0; const unsigned bits = read_register(counter, - NITIO_STATUS_REG(counter-> + NITIO_SHARED_STATUS_REG(counter-> counter_index)); if (bits & Gi_Armed_Bit(counter->counter_index)) { status |= COMEDI_COUNTER_ARMED; @@ -1679,7 +1679,7 @@ EXPORT_SYMBOL_GPL(ni_tio_rinsn); static unsigned ni_tio_next_load_register(struct ni_gpct *counter) { const unsigned bits = read_register(counter, - NITIO_STATUS_REG(counter-> + NITIO_SHARED_STATUS_REG(counter-> counter_index)); if (bits & Gi_Next_Load_Source_Bit(counter->counter_index)) diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h b/drivers/staging/comedi/drivers/ni_tio_internal.h index b5b5822d9355..5bd06897d4dc 100644 --- a/drivers/staging/comedi/drivers/ni_tio_internal.h +++ b/drivers/staging/comedi/drivers/ni_tio_internal.h @@ -30,7 +30,7 @@ #define NITIO_INPUT_SEL_REG(x) (NITIO_G0_INPUT_SEL + (x)) #define NITIO_CNT_MODE_REG(x) (NITIO_G0_CNT_MODE + (x)) #define NITIO_GATE2_REG(x) (NITIO_G0_GATE2 + (x)) -#define NITIO_STATUS_REG(x) (NITIO_G01_STATUS + ((x) / 2)) +#define NITIO_SHARED_STATUS_REG(x) (NITIO_G01_STATUS + ((x) / 2)) #define NITIO_RESET_REG(x) (NITIO_G01_RESET + ((x) / 2)) #define NITIO_STATUS1_REG(x) (NITIO_G01_STATUS1 + ((x) / 2)) #define NITIO_STATUS2_REG(x) (NITIO_G01_STATUS2 + ((x) / 2)) @@ -38,21 +38,7 @@ #define NITIO_DMA_STATUS_REG(x) (NITIO_G0_DMA_STATUS + (x)) #define NITIO_ABZ_REG(x) (NITIO_G0_ABZ + (x)) #define NITIO_INT_ACK_REG(x) (NITIO_G0_INT_ACK + (x)) - -static inline enum ni_gpct_register NITIO_Gi_Status_Reg(unsigned idx) -{ - switch (idx) { - case 0: - return NITIO_G0_STATUS; - case 1: - return NITIO_G1_STATUS; - case 2: - return NITIO_G2_STATUS; - case 3: - return NITIO_G3_STATUS; - } - return 0; -} +#define NITIO_STATUS_REG(x) (NITIO_G0_STATUS + (x)) static inline enum ni_gpct_register NITIO_Gi_Interrupt_Enable_Reg(unsigned idx) { diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c index 4f59f5a06c75..e7cff8dff574 100644 --- a/drivers/staging/comedi/drivers/ni_tiocmd.c +++ b/drivers/staging/comedi/drivers/ni_tiocmd.c @@ -354,11 +354,11 @@ void ni_tio_acknowledge_and_confirm(struct ni_gpct *counter, int *gate_error, int *stale_data) { const unsigned short gxx_status = read_register(counter, - NITIO_STATUS_REG + NITIO_SHARED_STATUS_REG (counter-> counter_index)); const unsigned short gi_status = read_register(counter, - NITIO_Gi_Status_Reg + NITIO_STATUS_REG (counter-> counter_index)); unsigned ack = 0; |