diff options
author | H Hartley Sweeten | 2014-05-28 16:26:54 -0700 |
---|---|---|
committer | Greg Kroah-Hartman | 2014-06-18 14:33:53 -0700 |
commit | d9c4261f6a35bf9067ba0fdaf8ed4775ee0c5cea (patch) | |
tree | d6b457f74964b699c3d9f6ced5c18ce7c7817718 | |
parent | 00a92c03be9ff392383e18ba222d480fc34d568c (diff) |
staging: comedi: ni_mio_common: fix the (*insn_read) for the freq_out counter
The (*insn_read) functions are supposed to "read" insn->n data values and
return the number of values read.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_mio_common.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 69be8eaff7ac..68cd92bf17c6 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -3878,12 +3878,17 @@ static unsigned ni_gpct_read_register(struct ni_gpct *counter, static int ni_freq_out_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 ni_private *devpriv = dev->private; + unsigned int val = devpriv->clock_and_fout & FOUT_Divider_mask; + int i; - data[0] = devpriv->clock_and_fout & FOUT_Divider_mask; - return 1; + for (i = 0; i < insn->n; i++) + data[i] = val; + + return insn->n; } static int ni_freq_out_insn_write(struct comedi_device *dev, |