]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
staging: comedi: adq12b: remove need for some local variables
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 9 Apr 2013 23:24:20 +0000 (16:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Apr 2013 19:47:51 +0000 (12:47 -0700)
The 'unipolar' and 'differential' local variables are not needed
in the adb12b_attach() function. Just use the cached private
data variables.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/adq12b.c

index 71ed5904382e5b5ffce45a0623aedaa5210484fb..44e8f0e2d601aa267fc33527e0e29806d652d55d 100644 (file)
@@ -213,12 +213,8 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        struct adq12b_private *devpriv;
        struct comedi_subdevice *s;
-       int unipolar, differential;
        int ret;
 
-       unipolar = it->options[1];
-       differential = it->options[2];
-
        ret = comedi_request_region(dev, it->options[0], ADQ12B_SIZE);
        if (ret)
                return ret;
@@ -228,8 +224,8 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return -ENOMEM;
        dev->private = devpriv;
 
-       devpriv->unipolar = unipolar;
-       devpriv->differential = differential;
+       devpriv->unipolar = it->options[1];
+       devpriv->differential = it->options[2];
        devpriv->digital_state = 0;
        /*
         * initialize channel and range to -1 so we make sure we
@@ -245,7 +241,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        s = &dev->subdevices[0];
        /* analog input subdevice */
        s->type = COMEDI_SUBD_AI;
-       if (differential) {
+       if (devpriv->differential) {
                s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
                s->n_chan = 8;
        } else {
@@ -253,7 +249,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                s->n_chan = 16;
        }
 
-       if (unipolar)
+       if (devpriv->unipolar)
                s->range_table = &range_adq12b_ai_unipolar;
        else
                s->range_table = &range_adq12b_ai_bipolar;