From: H Hartley Sweeten Date: Wed, 27 Jun 2012 16:17:17 +0000 (-0700) Subject: staging: comedi: cb_pcidas: fix dac08_write_insn() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ac55ca32ca40de3cb52a1ca73ca4a9250e07eefd;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git staging: comedi: cb_pcidas: fix dac08_write_insn() As pointed out by Ian Abbott, the comedi INSN_WRITE instructions are meant to iterate over, and write, all the data[] passed from the comedi core. Modify dac08_write_insn() to work as intended. Since doc08_write_insn() now returns the proper response to the core, make the dac08_write() helper return void. Signed-off-by: H Hartley Sweeten Reported-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c index 3ba75afe4e05..301444e09433 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas.c +++ b/drivers/staging/comedi/drivers/cb_pcidas.c @@ -659,7 +659,7 @@ static int caldac_read_insn(struct comedi_device *dev, } /* 1602/16 pregain offset */ -static int dac08_write(struct comedi_device *dev, unsigned int value) +static void dac08_write(struct comedi_device *dev, unsigned int value) { struct cb_pcidas_private *devpriv = dev->private; unsigned long cal_reg; @@ -680,14 +680,18 @@ static int dac08_write(struct comedi_device *dev, unsigned int value) outw(value, cal_reg); udelay(1); } - return 1; /* insn->n */ } static int dac08_write_insn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) { - return dac08_write(dev, data[0]); + int i; + + for (i = 0; i < insn->n; i++) + dac08_write(dev, data[i]); + + return insn->n; } static int dac08_read_insn(struct comedi_device *dev,