aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-04-09 19:24:20 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-11 15:47:51 -0400
commitf19df8b0c0a9598bf469692e28dc31c8c0dc1e89 (patch)
tree4704be6c330ad134f3f4844d8e5632b0bf0845f0 /drivers/staging
parentb8c5d2ca05e2813257e1ed38983d4b5307f8f676 (diff)
staging: comedi: adq12b: remove need for some local variables
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/comedi/drivers/adq12b.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/adq12b.c b/drivers/staging/comedi/drivers/adq12b.c
index 71ed5904382e..44e8f0e2d601 100644
--- a/drivers/staging/comedi/drivers/adq12b.c
+++ b/drivers/staging/comedi/drivers/adq12b.c
@@ -213,12 +213,8 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
213{ 213{
214 struct adq12b_private *devpriv; 214 struct adq12b_private *devpriv;
215 struct comedi_subdevice *s; 215 struct comedi_subdevice *s;
216 int unipolar, differential;
217 int ret; 216 int ret;
218 217
219 unipolar = it->options[1];
220 differential = it->options[2];
221
222 ret = comedi_request_region(dev, it->options[0], ADQ12B_SIZE); 218 ret = comedi_request_region(dev, it->options[0], ADQ12B_SIZE);
223 if (ret) 219 if (ret)
224 return ret; 220 return ret;
@@ -228,8 +224,8 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
228 return -ENOMEM; 224 return -ENOMEM;
229 dev->private = devpriv; 225 dev->private = devpriv;
230 226
231 devpriv->unipolar = unipolar; 227 devpriv->unipolar = it->options[1];
232 devpriv->differential = differential; 228 devpriv->differential = it->options[2];
233 devpriv->digital_state = 0; 229 devpriv->digital_state = 0;
234 /* 230 /*
235 * initialize channel and range to -1 so we make sure we 231 * 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)
245 s = &dev->subdevices[0]; 241 s = &dev->subdevices[0];
246 /* analog input subdevice */ 242 /* analog input subdevice */
247 s->type = COMEDI_SUBD_AI; 243 s->type = COMEDI_SUBD_AI;
248 if (differential) { 244 if (devpriv->differential) {
249 s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF; 245 s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
250 s->n_chan = 8; 246 s->n_chan = 8;
251 } else { 247 } else {
@@ -253,7 +249,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
253 s->n_chan = 16; 249 s->n_chan = 16;
254 } 250 }
255 251
256 if (unipolar) 252 if (devpriv->unipolar)
257 s->range_table = &range_adq12b_ai_unipolar; 253 s->range_table = &range_adq12b_ai_unipolar;
258 else 254 else
259 s->range_table = &range_adq12b_ai_bipolar; 255 s->range_table = &range_adq12b_ai_bipolar;