From 25e941affe11e258a213bb12e765dfaabd327c57 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 1 May 2015 15:00:01 -0700 Subject: [PATCH] staging: comedi: ni_stc.h: tidy up DAC[01]_Direct_Data registers Rename the CamelCase and convert the defines into a macro. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 2 +- drivers/staging/comedi/drivers/ni_stc.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index b9e35ead643c..4a94bc3986ef 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -2733,7 +2733,7 @@ static int ni_ao_insn_write(struct comedi_device *dev, } else if (devpriv->is_m_series) { reg = NI_M_DAC_DIRECT_DATA_REG(chan); } else { - reg = (chan) ? DAC1_Direct_Data : DAC0_Direct_Data; + reg = NI_E_DAC_DIRECT_DATA_REG(chan); } ni_ao_config_chanlist(dev, s, &insn->chanspec, 1, 0); diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index 2afa701eb4d0..23cc4902b905 100644 --- a/drivers/staging/comedi/drivers/ni_stc.h +++ b/drivers/staging/comedi/drivers/ni_stc.h @@ -638,13 +638,13 @@ static inline unsigned GPCT_DMA_Select_Mask(unsigned gpct_index) #define NI_E_AO_DEGLITCH BIT(1) #define NI_E_AO_CFG_BIP BIT(0) +#define NI_E_DAC_DIRECT_DATA_REG(x) (0x18 + ((x) * 2)) /* w16 */ + #define NI_E_8255_BASE 0x19 /* rw8 */ #define NI_E_AI_FIFO_DATA_REG 0x1c /* r16 */ #define NI_E_AO_FIFO_DATA_REG 0x1e /* w16 */ -#define DAC0_Direct_Data 0x18 -#define DAC1_Direct_Data 0x1a /* 611x registers (these boards differ from the e-series) */ -- 2.39.5