Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc778ef5 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 16b47750
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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;