staging: comedi: ni_stc.h: tidy up Joint_Status_1_Register
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 1 May 2015 21:59:46 +0000 (14:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 May 2015 17:05:15 +0000 (19:05 +0200)
Rename the CamelCase. Use the BIT() macro to define the bits.

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>
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_stc.h

index b194d1558463428600d0db7c305152afce28ef88..9051477f7ac6ae86ef4771bb04e5b5b63c47a546 100644 (file)
@@ -423,7 +423,7 @@ static const struct mio_regmap m_series_stc_read_regmap[] = {
        [NISTC_AO_UI_SAVE_REG]          = { 0x120, 4 },
        [NISTC_AO_BC_SAVE_REG]          = { 0x124, 4 },
        [NISTC_AO_UC_SAVE_REG]          = { 0x128, 4 },
-       [Joint_Status_1_Register]       = { 0x136, 2 },
+       [NISTC_STATUS1_REG]             = { 0x136, 2 },
        [DIO_Serial_Input_Register]     = { 0x009, 1 },
        [Joint_Status_2_Register]       = { 0x13a, 2 },
        [AI_SI_Save_Registers]          = { 0x180, 4 },
@@ -3522,8 +3522,8 @@ static int ni_serial_hw_readwrite8(struct comedi_device *dev,
        devpriv->dio_output |= NISTC_DIO_OUT_SERIAL(data_out);
        ni_stc_writew(dev, devpriv->dio_output, NISTC_DIO_OUT_REG);
 
-       status1 = ni_stc_readw(dev, Joint_Status_1_Register);
-       if (status1 & DIO_Serial_IO_In_Progress_St) {
+       status1 = ni_stc_readw(dev, NISTC_STATUS1_REG);
+       if (status1 & NISTC_STATUS1_SERIO_IN_PROG) {
                err = -EBUSY;
                goto Error;
        }
@@ -3533,8 +3533,8 @@ static int ni_serial_hw_readwrite8(struct comedi_device *dev,
        devpriv->dio_control &= ~NISTC_DIO_CTRL_HW_SER_START;
 
        /* Wait until STC says we're done, but don't loop infinitely. */
-       while ((status1 = ni_stc_readw(dev, Joint_Status_1_Register)) &
-              DIO_Serial_IO_In_Progress_St) {
+       while ((status1 = ni_stc_readw(dev, NISTC_STATUS1_REG)) &
+              NISTC_STATUS1_SERIO_IN_PROG) {
                /* Delay one bit per loop */
                udelay((devpriv->serial_interval_ns + 999) / 1000);
                if (--count < 0) {
@@ -3545,8 +3545,10 @@ static int ni_serial_hw_readwrite8(struct comedi_device *dev,
                }
        }
 
-       /* Delay for last bit. This delay is absolutely necessary, because
-          DIO_Serial_IO_In_Progress_St goes high one bit too early. */
+       /*
+        * Delay for last bit. This delay is absolutely necessary, because
+        * NISTC_STATUS1_SERIO_IN_PROG goes high one bit too early.
+        */
        udelay((devpriv->serial_interval_ns + 999) / 1000);
 
        if (data_in)
@@ -3724,7 +3726,7 @@ static const struct mio_regmap ni_gpct_to_stc_regmap[] = {
        [NITIO_G1_GATE2]        = { 0x1b6, 2 }, /* M-Series only */
        [NITIO_G01_STATUS]      = { NISTC_G01_STATUS_REG, 2 },
        [NITIO_G01_RESET]       = { NISTC_RESET_REG, 2 },
-       [NITIO_G01_STATUS1]     = { Joint_Status_1_Register, 2 },
+       [NITIO_G01_STATUS1]     = { NISTC_STATUS1_REG, 2 },
        [NITIO_G01_STATUS2]     = { Joint_Status_2_Register, 2 },
        [NITIO_G0_DMA_CFG]      = { 0x1b8, 2 }, /* M-Series only */
        [NITIO_G1_DMA_CFG]      = { 0x1ba, 2 }, /* M-Series only */
index af07e4c7f69861453520cdbd096d8f99fd35c84f..2d7f342790fa486299a3dce82eae556e9a9adc63 100644 (file)
 #define NISTC_AO_BC_SAVE_REG           18
 #define NISTC_AO_UC_SAVE_REG           20
 
+#define NISTC_STATUS1_REG              27
+#define NISTC_STATUS1_SERIO_IN_PROG    BIT(12)
+
 #define AI_SI_Save_Registers           64
 #define AI_SC_Save_Registers           66
 
-#define Joint_Status_1_Register         27
-#define DIO_Serial_IO_In_Progress_St            _bit12
-
 #define DIO_Serial_Input_Register       28
 #define Joint_Status_2_Register         29
 enum Joint_Status_2_Bits {
This page took 0.040771 seconds and 5 git commands to generate.