staging: comedi: addi_apci_3xxx: remove 'b_AiInitialisation' from private data
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 12 Jun 2013 23:16:05 +0000 (16:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Jun 2013 21:33:42 +0000 (14:33 -0700)
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 <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_apci3xxx.c
drivers/staging/comedi/drivers/addi_apci_3xxx.c

index 77599e4..a6142ab 100644 (file)
@@ -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;
 }
index ffcacad..88b6092 100644 (file)
@@ -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;