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

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

staging: comedi: cb_pcimdas: tidy up cb_pcimdas_auto_attach()



For aesthetics, add some whitespace to the subdevice init.

Remove the unnecessary comments as well as the initialization of the
analog input subdevice 'len_chanlist'. That member is only used by
subdevices that support async commands.

For aesthetics, rename the analog input subdevice (*insn_read) function.

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 21314bc6
Loading
Loading
Loading
Loading
+17 −19
Original line number Diff line number Diff line
@@ -175,9 +175,10 @@ static int cb_pcimdas_ai_eoc(struct comedi_device *dev,
	return -EBUSY;
}

static int cb_pcimdas_ai_rinsn(struct comedi_device *dev,
static int cb_pcimdas_ai_insn_read(struct comedi_device *dev,
				   struct comedi_subdevice *s,
			       struct comedi_insn *insn, unsigned int *data)
				   struct comedi_insn *insn,
				   unsigned int *data)
{
	struct cb_pcimdas_private *devpriv = dev->private;
	unsigned int chan = CR_CHAN(insn->chanspec);
@@ -294,9 +295,8 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
	if (ret)
		return ret;

	/* Analog Input subdevice */
	s = &dev->subdevices[0];
	/* dev->read_subdev=s; */
	/*  analog input subdevice */
	s->type		= COMEDI_SUBD_AI;
	s->subdev_flags	= SDF_READABLE;
	if (cb_pcimdas_is_ai_se(dev)) {
@@ -309,12 +309,10 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
	s->maxdata	= 0xffff;
	s->range_table	= cb_pcimdas_is_ai_uni(dev) ? &cb_pcimdas_ai_uni_range
						    : &cb_pcimdas_ai_bip_range;
	s->len_chanlist = 1;	/*  This is the maximum chanlist length that */
	/*  the board can handle */
	s->insn_read = cb_pcimdas_ai_rinsn;
	s->insn_read	= cb_pcimdas_ai_insn_read;

	/* Analog Output subdevice */
	s = &dev->subdevices[1];
	/*  analog output subdevice */
	s->type		= COMEDI_SUBD_AO;
	s->subdev_flags	= SDF_WRITABLE;
	s->n_chan	= 2;
@@ -326,8 +324,8 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
	if (ret)
		return ret;

	/* Digital I/O subdevice */
	s = &dev->subdevices[2];
	/* digital i/o subdevice */
	ret = subdev_8255_init(dev, s, NULL, PCIMDAS_8255_BASE);
	if (ret)
		return ret;