]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
staging: comedi: addi_apci_3120: remove private data 'ui_EocEosConversionTime'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Nov 2014 17:54:29 +0000 (10:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:34:01 +0000 (09:34 -0800)
This driver tries to be tricky and allow passing an analog input conversion time
for the (*insn_read) in the (*insn_config).  The (*insn_config) doesn't follow
the comedi API and this programmable conversion time is not part of the API for
(*insn_read) operations.

Remove the member from the private data and use a fixed 10us (10000ns) conversion
time in the (*insn_read).

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_apci3120.c
drivers/staging/comedi/drivers/addi_apci_3120.c

index 2656e53999f8ea386c7dc0029351a582ac6beb34..9b18abf13b24633d56bc4a1cae4f22db42d8059d 100644 (file)
@@ -114,9 +114,6 @@ static int apci3120_ai_insn_config(struct comedi_device *dev,
        if (data[0] != APCI3120_EOC_MODE)
                return -1;
 
-       /*  Check for Conversion time to be added */
-       devpriv->ui_EocEosConversionTime = data[2];
-
        devpriv->b_InterruptMode = APCI3120_EOC_MODE;
        if (data[1])
                devpriv->b_EocEosInterrupt = APCI3120_ENABLE;
@@ -172,10 +169,7 @@ static int apci3120_ai_insn_read(struct comedi_device *dev,
        unsigned short us_TmpValue, i;
 
        /*  fix conversion time to 10 us */
-       if (!devpriv->ui_EocEosConversionTime)
-               ns = 10000;
-       else
-               ns = devpriv->ui_EocEosConversionTime;
+       ns = 10000;
 
        /*  Clear software registers */
        devpriv->timer_mode = 0;
@@ -240,7 +234,6 @@ static int apci3120_ai_insn_read(struct comedi_device *dev,
                        dev_err(dev->class_dev, "inputs wrong\n");
 
                }
-               devpriv->ui_EocEosConversionTime = 0;   /*  re initializing the variable */
        }
 
        return insn->n;
@@ -254,7 +247,6 @@ static int apci3120_reset(struct comedi_device *dev)
        devpriv->ai_running = 0;
        devpriv->b_EocEosInterrupt = APCI3120_DISABLE;
        devpriv->b_InterruptMode = APCI3120_EOC_MODE;
-       devpriv->ui_EocEosConversionTime = 0;   /*  set eoc eos conv time to 0 */
 
        /*  variables used in timer subdevice */
        devpriv->b_Timer2Mode = 0;
index 0f3dabfabfc8ac9a0924fb98e4a0e79f4fe60543..13c06cd18456115748782384c1101bafd1e8f186 100644 (file)
@@ -129,7 +129,6 @@ struct apci3120_private {
        unsigned int ai_running:1;
        unsigned char b_InterruptMode;
        unsigned char b_EocEosInterrupt;
-       unsigned int ui_EocEosConversionTime;
        unsigned char b_ExttrigEnable;
        struct task_struct *tsk_Current;
 };