summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/adq12b.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-05-28 16:34:50 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-18 14:34:44 -0700
commitbc778ef526ed4daa027368cc5d8b8ad893b3af0c (patch)
treedf56bea71a06a51b36217038973a15c477195dc6 /drivers/staging/comedi/drivers/adq12b.c
parent16b4775006e29fa9873881aca1d7091f93f61349 (diff)
staging: comedi: adq12b: remove 'differential' from private data
This member of the private data is only used during the attach to determine if there are 8 differential or 16 single-ended analog inputs. Remove the member and use the comedi_devconfig option directly. Also, fix the subdev_flags when differential analog inputs are used. 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>
Diffstat (limited to 'drivers/staging/comedi/drivers/adq12b.c')
-rw-r--r--drivers/staging/comedi/drivers/adq12b.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/adq12b.c b/drivers/staging/comedi/drivers/adq12b.c
index 40e91d718d38..67003206e832 100644
--- a/drivers/staging/comedi/drivers/adq12b.c
+++ b/drivers/staging/comedi/drivers/adq12b.c
@@ -114,7 +114,6 @@ static const struct comedi_lrange range_adq12b_ai_unipolar = {
};
struct adq12b_private {
- int differential; /* option 3 of comedi_config */
unsigned int last_ctreg;
};
@@ -217,7 +216,6 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (!devpriv)
return -ENOMEM;
- devpriv->differential = it->options[2];
devpriv->last_ctreg = -1; /* force ctreg update */
ret = comedi_alloc_subdevices(dev, 3);
@@ -227,8 +225,8 @@ 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 (devpriv->differential) {
- s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
+ if (it->options[2]) {
+ s->subdev_flags = SDF_READABLE | SDF_DIFF;
s->n_chan = 8;
} else {
s->subdev_flags = SDF_READABLE | SDF_GROUND;