]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: ni_labpc: fix labpc_eeprom_insn_read()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 22 Mar 2013 16:57:48 +0000 (09:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 18:43:02 +0000 (11:43 -0700)
The comedi core expects the (*insn_read) operations to read insn->n
values and return the number of values actually read.

Make this function work like the core expects.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_labpc.c

index 234f85e0f2f269f83ddf92681c3b9208bb0ead1c..0afcede602ecf956421fd19ec170b160ab7cf1a9 100644 (file)
@@ -1591,10 +1591,13 @@ static int labpc_eeprom_insn_read(struct comedi_device *dev,
                                  unsigned int *data)
 {
        struct labpc_private *devpriv = dev->private;
+       unsigned int chan = CR_CHAN(insn->chanspec);
+       int i;
 
-       data[0] = devpriv->eeprom_data[CR_CHAN(insn->chanspec)];
+       for (i = 0; i < insn->n; i++)
+               data[i] = devpriv->eeprom_data[chan];
 
-       return 1;
+       return insn->n;
 }
 
 int labpc_common_attach(struct comedi_device *dev, unsigned long iobase,