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

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

staging: comedi: vmk80xx: cleanup analog output subdevice init



Change the type for the analog output 'ao_chans' boardinfo to match
the comedi_subdevice type it is set to. For aesthetic reasons, rename
the variable also.

Rename the (*insn_write) and (*insn_read) functions for the analog
output subdevice to make grepping easier.

For aesthetic reasons, add some whitespace to the subdevice init.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 658cd3ac
Loading
Loading
Loading
Loading
+19 −17
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ struct vmk80xx_board {
	const struct comedi_lrange *range;
	int ai_nchans;
	unsigned int ai_maxdata;
	__u8 ao_chans;
	int ao_nchans;
	__u8 di_chans;
	__le16 cnt_bits;
	__u8 pwm_chans;
@@ -175,7 +175,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
		.range		= &vmk8055_range,
		.ai_nchans	= 2,
		.ai_maxdata	= 0x00ff,
		.ao_chans	= 2,
		.ao_nchans	= 2,
		.di_chans	= 6,
		.cnt_bits	= 16,
		.pwm_chans	= 0,
@@ -187,7 +187,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
		.range		= &vmk8061_range,
		.ai_nchans	= 8,
		.ai_maxdata	= 0x03ff,
		.ao_chans	= 8,
		.ao_nchans	= 8,
		.di_chans	= 8,
		.cnt_bits	= 0,
		.pwm_chans	= 1,
@@ -585,9 +585,10 @@ static int vmk80xx_ai_insn_read(struct comedi_device *dev,
	return n;
}

static int vmk80xx_ao_winsn(struct comedi_device *dev,
static int vmk80xx_ao_insn_write(struct comedi_device *dev,
				 struct comedi_subdevice *s,
			    struct comedi_insn *insn, unsigned int *data)
				 struct comedi_insn *insn,
				 unsigned int *data)
{
	struct vmk80xx_private *devpriv = dev->private;
	int chan;
@@ -629,9 +630,10 @@ static int vmk80xx_ao_winsn(struct comedi_device *dev,
	return n;
}

static int vmk80xx_ao_rinsn(struct comedi_device *dev,
static int vmk80xx_ao_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 vmk80xx_private *devpriv = dev->private;
	int chan;
@@ -1206,13 +1208,13 @@ static int vmk80xx_attach_common(struct comedi_device *dev)
	s = &dev->subdevices[1];
	s->type		= COMEDI_SUBD_AO;
	s->subdev_flags	= SDF_WRITEABLE | SDF_GROUND;
	s->n_chan = boardinfo->ao_chans;
	s->n_chan	= boardinfo->ao_nchans;
	s->maxdata	= 0x00ff;
	s->range_table	= boardinfo->range;
	s->insn_write = vmk80xx_ao_winsn;
	s->insn_write	= vmk80xx_ao_insn_write;
	if (devpriv->model == VMK8061_MODEL) {
		s->subdev_flags	|= SDF_READABLE;
		s->insn_read = vmk80xx_ao_rinsn;
		s->insn_read	= vmk80xx_ao_insn_read;
	}

	/* Digital input subdevice */