From: H Hartley Sweeten Date: Wed, 12 Jun 2013 23:16:05 +0000 (-0700) Subject: staging: comedi: addi_apci_3xxx: remove 'b_AiInitialisation' from private data X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=08be3097fa1597f13b97ab390b0e80ce07cb4796;p=linux-beck.git 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: 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 77599e437f37..a6142abdaeeb 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c @@ -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; } diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c index ffcacade5f82..88b609229c57 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c +++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c @@ -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;