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

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

staging: comedi: usbduxsigma: remove 'ao_chanlist' from private data



This member of the private data is just a copy of the channels from
the cmd->chanlist. Remove the member and just use the cmd->chanlist
directly.

Remove the unneeded 'len' local variable in usbduxsigma_ao_urb_complete().
This is just the cmd->chanlist_len.

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 a49b45fb
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -161,7 +161,6 @@ struct usbduxsigma_private {
	/* input buffer for single insn */
	uint8_t *insn_buf;

	uint8_t ao_chanlist[USBDUXSIGMA_NUM_AO_CHAN];
	unsigned int ao_readback[USBDUXSIGMA_NUM_AO_CHAN];

	unsigned high_speed:1;
@@ -361,7 +360,6 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)
	struct comedi_subdevice *s = dev->write_subdev;
	struct comedi_cmd *cmd = &s->async->cmd;
	uint8_t *datap;
	int len;
	int ret;
	int i;

@@ -417,10 +415,9 @@ static void usbduxsigma_ao_urb_complete(struct urb *urb)

		/* transmit data to the USB bus */
		datap = urb->transfer_buffer;
		len = s->async->cmd.chanlist_len;
		*datap++ = len;
		for (i = 0; i < len; i++) {
			unsigned int chan = devpriv->ao_chanlist[i];
		*datap++ = cmd->chanlist_len;
		for (i = 0; i < cmd->chanlist_len; i++) {
			unsigned int chan = CR_CHAN(cmd->chanlist[i]);
			unsigned short val;

			ret = comedi_buf_get(s, &val);
@@ -1001,14 +998,11 @@ static int usbduxsigma_ao_cmd(struct comedi_device *dev,
	struct usbduxsigma_private *devpriv = dev->private;
	struct comedi_cmd *cmd = &s->async->cmd;
	int ret;
	int i;

	down(&devpriv->sem);

	/* set current channel of the running acquisition to zero */
	s->async->cur_chan = 0;
	for (i = 0; i < cmd->chanlist_len; ++i)
		devpriv->ao_chanlist[i] = CR_CHAN(cmd->chanlist[i]);

	devpriv->ao_counter = devpriv->ao_timer;