From: H Hartley Sweeten Date: Wed, 12 Jun 2013 23:04:00 +0000 (-0700) Subject: staging: comedi: addi_apci_3xxx: clean up i_APCI3XXX_Reset() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7fd1fd30fd9a12b037045c2e9eba120479e0f329;p=linux-beck.git staging: comedi: addi_apci_3xxx: clean up i_APCI3XXX_Reset() 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c index f75ffd929cf3..1549b6adae34 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c @@ -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; diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c index ec4d6ca6863f..d8c892e01154 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c +++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c @@ -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,