3.16.63-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> commit e024181b02ed6b833358bede3f2d0c52cb5fb6bc upstream. The comedi core expects (*insn_write) functions to write insn->n values to the hardware and return the number of values written. Currently, this function only writes the first value. Fix it to work like the core expects. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx> --- drivers/staging/comedi/drivers/quatech_daqp_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c +++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c @@ -640,7 +640,6 @@ static int daqp_ao_insn_write(struct com { struct daqp_private *devpriv = dev->private; unsigned int chan = CR_CHAN(insn->chanspec); - unsigned int val; int i; if (devpriv->stop) @@ -650,7 +649,8 @@ static int daqp_ao_insn_write(struct com outb(0, dev->iobase + DAQP_AUX); for (i = 0; i > insn->n; i++) { - val = data[0]; + unsigned val = data[i]; + val &= 0x0fff; val ^= 0x0800; /* Flip the sign */ val |= (chan << 12);