staging: comedi: ni_tio: tidy up Gi_DMA_Status_Reg_Bits
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 28 Jul 2014 17:26:57 +0000 (10:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Jul 2014 23:51:00 +0000 (16:51 -0700)
Convert this enum into defines and rename the CamelCase symbols.

For aesthetics, move the new defines so they are associated with
the register define.

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_tio_internal.h
drivers/staging/comedi/drivers/ni_tiocmd.c

index a74cec40611c9f24b717b48624b5afb60c898573..db6b56307db9a67df5d30e036880dda97bfbe5c6 100644 (file)
 #define GI_DMA_RESET                   (1 << 3)
 #define GI_DMA_BANKSW_ERROR            (1 << 4)
 #define NITIO_DMA_STATUS_REG(x)                (NITIO_G0_DMA_STATUS + (x))
+#define GI_DMA_READBANK                        (1 << 13)
+#define GI_DRQ_ERROR                   (1 << 14)
+#define GI_DRQ_STATUS                  (1 << 15)
 #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))
 #define NITIO_INT_ENA_REG(x)           (NITIO_G0_INT_ENA + (x))
 
-enum Gi_DMA_Status_Reg_Bits {
-       Gi_DMA_Readbank_Bit = 0x2000,
-       Gi_DRQ_Error_Bit = 0x4000,
-       Gi_DRQ_Status_Bit = 0x8000
-};
-
 enum G02_Interrupt_Acknowledge_Bits {
        G0_Gate_Error_Confirm_Bit = 0x20,
        G0_TC_Error_Confirm_Bit = 0x40
index d80bb35aed40eb19d61b2b04c41b752a49b99021..f8019bf57ea5f0edf9e38c878bde8a7104244380 100644 (file)
@@ -443,7 +443,7 @@ void ni_tio_handle_interrupt(struct ni_gpct *counter,
        case ni_gpct_variant_m_series:
        case ni_gpct_variant_660x:
                if (read_register(counter, NITIO_DMA_STATUS_REG(cidx)) &
-                   Gi_DRQ_Error_Bit) {
+                   GI_DRQ_ERROR) {
                        dev_notice(counter->counter_dev->dev->class_dev,
                                   "%s: Gi_DRQ_Error detected.\n", __func__);
                        s->async->events |= COMEDI_CB_OVERFLOW;