[PATCH 087/107] staging: comedi: ni_stc.h: tidy up XXX_Status register and bits

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

 



Rename the CamelCase. Use the BIT() macro to define the bits.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/ni_mio_common.c |  7 ++++---
 drivers/staging/comedi/drivers/ni_stc.h        | 10 +++-------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index 518c033..b4a8a4c 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -1248,7 +1248,7 @@ static void get_last_sample_611x(struct comedi_device *dev)
 		return;
 
 	/* Check if there's a single sample stuck in the FIFO */
-	if (ni_readb(dev, XXX_Status) & 0x80) {
+	if (ni_readb(dev, NI_E_STATUS_REG) & 0x80) {
 		dl = ni_readl(dev, ADC_FIFO_Data_611x);
 		data = dl & 0xffff;
 		comedi_buf_write_samples(s, &data, 1);
@@ -1946,7 +1946,7 @@ static int ni_ai_insn_read(struct comedi_device *dev,
 			/* The 611x has screwy 32-bit FIFOs. */
 			d = 0;
 			for (i = 0; i < NI_TIMEOUT; i++) {
-				if (ni_readb(dev, XXX_Status) & 0x80) {
+				if (ni_readb(dev, NI_E_STATUS_REG) & 0x80) {
 					d = ni_readl(dev, ADC_FIFO_Data_611x);
 					d >>= 16;
 					d &= 0xffff;
@@ -4258,7 +4258,8 @@ static int ni_read_eeprom(struct comedi_device *dev, int addr)
 	for (bit = 0x80; bit; bit >>= 1) {
 		ni_writeb(dev, 0x04, Serial_Command);
 		ni_writeb(dev, 0x05, Serial_Command);
-		bitstring |= ((ni_readb(dev, XXX_Status) & PROMOUT) ? bit : 0);
+		if (ni_readb(dev, NI_E_STATUS_REG) & NI_E_STATUS_PROMOUT)
+			bitstring |= bit;
 	}
 	ni_writeb(dev, 0x00, Serial_Command);
 
diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h
index ac9261a..643f3c2 100644
--- a/drivers/staging/comedi/drivers/ni_stc.h
+++ b/drivers/staging/comedi/drivers/ni_stc.h
@@ -567,14 +567,10 @@
 #define NI_E_STC_WINDOW_ADDR_REG	0x00	/* rw16 */
 #define NI_E_STC_WINDOW_DATA_REG	0x02	/* rw16 */
 
-/* i/o port offsets */
+#define NI_E_STATUS_REG			0x01	/* r8 */
+#define NI_E_STATUS_AI_FIFO_LOWER_NE	BIT(3)
+#define NI_E_STATUS_PROMOUT		BIT(0)
 
-/* 8 bit registers */
-#define XXX_Status			0x01
-enum XXX_Status_Bits {
-	PROMOUT = 0x1,
-	AI_FIFO_LOWER_NOT_EMPTY = 0x8,
-};
 #define Serial_Command			0x0d
 #define Misc_Command			0x0f
 #define Port_A				0x19
-- 
2.3.0

_______________________________________________
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