Commit 46ad4793 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: addi_apci_3120: remove private data 'ui_EocEosConversionTime'



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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 34c0ae09
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -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;

	/*  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;
+0 −1
Original line number Diff line number Diff line
@@ -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;
};