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

staging: comedi: addi_apci_3xxx: remove 'b_AiInitialisation' from private data



This variable is set during the attach of the board and never cleared
so the test in i_APCI3XXX_InsnReadAnalogInput() will always succeed.
Just remove the variable to help with cleaning up this driver.

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 61048cf4
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -158,9 +158,6 @@ static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev,
									b_SingelDiff
									=
									b_SingleDiff;
								devpriv->
									b_AiInitialisation
									= 1;

			      /*******************************/
								/* Set the convert timing unit */
@@ -327,11 +324,6 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev,
	unsigned int dw_AcquisitionCpt = 0;
	unsigned char b_Interrupt = 0;

	/*************************************/
	/* Test if operating mode configured */
	/*************************************/

	if (devpriv->b_AiInitialisation) {
	   /***************************/
		/* Test the channel number */
	   /***************************/
@@ -502,13 +494,6 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev,
				i_ReturnValue = -101;
			}
		}
	} else {
	   /***************************/
		/* Channel selection error */
	   /***************************/

		printk("Operating mode not configured\n");
		i_ReturnValue = -1;
	}
	return i_ReturnValue;
}
+0 −4
Original line number Diff line number Diff line
@@ -370,7 +370,6 @@ struct apci3xxx_private {
	int iobase;
	int i_IobaseReserved;
	void __iomem *dw_AiBase;
	unsigned char b_AiInitialisation;
	unsigned int ui_AiNbrofChannels;	/*  how many channels is measured */
	unsigned int ui_AiReadData[32];
	unsigned char b_EocEosInterrupt;
@@ -646,9 +645,6 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
		s->len_chanlist = board->i_AiChannelList;
		s->range_table = &apci3xxx_ai_range;

		/* Set the initialisation flag */
		devpriv->b_AiInitialisation = 1;

		s->insn_config = i_APCI3XXX_InsnConfigAnalogInput;
		s->insn_read = i_APCI3XXX_InsnReadAnalogInput;