Commit 47ef2541 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_mio_common: fix ni_ao_insn_read()

The comedi core expects (*insn_read) functions to return insn->n
data smaples. Fix this function to work like the core expects.
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 93fac790
...@@ -2939,14 +2939,18 @@ static int ni_ao_config_chanlist(struct comedi_device *dev, ...@@ -2939,14 +2939,18 @@ static int ni_ao_config_chanlist(struct comedi_device *dev,
} }
static int ni_ao_insn_read(struct comedi_device *dev, static int ni_ao_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data) unsigned int *data)
{ {
struct ni_private *devpriv = dev->private; struct ni_private *devpriv = dev->private;
unsigned int chan = CR_CHAN(insn->chanspec);
int i;
data[0] = devpriv->ao[CR_CHAN(insn->chanspec)]; for (i = 0; i < insn->n; i++)
data[i] = devpriv->ao[chan];
return 1; return insn->n;
} }
static int ni_ao_insn_write(struct comedi_device *dev, static int ni_ao_insn_write(struct comedi_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment