staging: comedi: addi_apci_3xxx: clean up i_APCI3XXX_Reset()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:04:00 +0000 (16:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:37 +0000 (14:33 -0700)
Rename the CamelCase function and variables.

Remove the extra comments. Leave the main comments to help with further
cleanup of this driver.

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/addi-data/hwdrv_apci3xxx.c
drivers/staging/comedi/drivers/addi_apci_3xxx.c

index f75ffd9..1549b6a 100644 (file)
@@ -1306,66 +1306,33 @@ static int apci3xxx_do_insn_bits(struct comedi_device *dev,
        return insn->n;
 }
 
-/*
-+----------------------------------------------------------------------------+
-| Function   Name   : int i_APCI3XXX_Reset(struct comedi_device *dev)               |                                                         +----------------------------------------------------------------------------+
-| Task              :resets all the registers                                |
-+----------------------------------------------------------------------------+
-| Input Parameters  : struct comedi_device *dev                                     |
-+----------------------------------------------------------------------------+
-| Output Parameters : -                                                      |
-+----------------------------------------------------------------------------+
-| Return Value      : -                                                      |
-+----------------------------------------------------------------------------+
-*/
-
-static int i_APCI3XXX_Reset(struct comedi_device *dev)
+static int apci3xxx_reset(struct comedi_device *dev)
 {
        struct addi_private *devpriv = dev->private;
-       unsigned char b_Cpt = 0;
+       unsigned int val;
+       int i;
 
-       /*************************/
        /* Disable the interrupt */
-       /*************************/
-
        disable_irq(dev->irq);
 
-       /****************************/
        /* Reset the interrupt flag */
-       /****************************/
-
        devpriv->b_EocEosInterrupt = 0;
 
-       /***************************/
        /* Clear the start command */
-       /***************************/
-
        writel(0, devpriv->dw_AiBase + 8);
 
-       /*****************************/
        /* Reset the interrupt flags */
-       /*****************************/
-
-       writel(readl(devpriv->dw_AiBase + 16), devpriv->dw_AiBase + 16);
+       val = readl(devpriv->dw_AiBase + 16);
+       writel(val, devpriv->dw_AiBase + 16);
 
-       /*****************/
        /* clear the EOS */
-       /*****************/
-
        readl(devpriv->dw_AiBase + 20);
 
-       /******************/
        /* Clear the FIFO */
-       /******************/
+       for (i = 0; i < 16; i++)
+               val = readl(devpriv->dw_AiBase + 28);
 
-       for (b_Cpt = 0; b_Cpt < 16; b_Cpt++) {
-               readl(devpriv->dw_AiBase + 28);
-       }
-
-       /************************/
        /* Enable the interrupt */
-       /************************/
-
        enable_irq(dev->irq);
 
        return 0;
index ec4d6ca..d8c892e 100644 (file)
@@ -53,7 +53,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ttl_config             = i_APCI3XXX_InsnConfigInitTTLIO,
@@ -75,7 +75,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ttl_config             = i_APCI3XXX_InsnConfigInitTTLIO,
@@ -97,7 +97,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ttl_config             = i_APCI3XXX_InsnConfigInitTTLIO,
@@ -119,7 +119,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ttl_config             = i_APCI3XXX_InsnConfigInitTTLIO,
@@ -141,7 +141,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ttl_config             = i_APCI3XXX_InsnConfigInitTTLIO,
@@ -163,7 +163,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ttl_config             = i_APCI3XXX_InsnConfigInitTTLIO,
@@ -188,7 +188,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -215,7 +215,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -242,7 +242,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -269,7 +269,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -296,7 +296,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -323,7 +323,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -350,7 +350,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -376,7 +376,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -402,7 +402,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -428,7 +428,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 10000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -457,7 +457,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -488,7 +488,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -519,7 +519,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -550,7 +550,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
@@ -576,7 +576,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 7,
                .ui_MinAcquisitiontimeNs = 2500,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -597,7 +597,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -618,7 +618,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -639,7 +639,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .b_AvailableConvertUnit = 6,
                .ui_MinAcquisitiontimeNs = 5000,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ai_config              = i_APCI3XXX_InsnConfigAnalogInput,
                .ai_read                = i_APCI3XXX_InsnReadAnalogInput,
                .di_bits                = apci3xxx_di_insn_bits,
@@ -655,7 +655,7 @@ static const struct addi_board apci3xxx_boardtypes[] = {
                .pr_AoRangelist         = &range_apci3XXX_ao,
                .i_NbrTTLChannel        = 24,
                .interrupt              = v_APCI3XXX_Interrupt,
-               .reset                  = i_APCI3XXX_Reset,
+               .reset                  = apci3xxx_reset,
                .ao_write               = i_APCI3XXX_InsnWriteAnalogOutput,
                .ttl_config             = i_APCI3XXX_InsnConfigInitTTLIO,
                .ttl_bits               = i_APCI3XXX_InsnBitsTTLIO,