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

staging: comedi: don't clear 'data' on (*insn_read) timeout

It's not necessary to clear the returned data pointer when an (*insn_read)
times out. For aesthetics, remove all of these in the drivers.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 22ca19d9
......@@ -748,7 +748,6 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pci9111_ai_eoc, 0);
if (ret) {
data[i] = 0;
pci9111_fifo_reset(dev);
return ret;
}
......
......@@ -614,7 +614,6 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0);
if (ret) {
data[n] = 0;
outl(0, dev->iobase + PCI9118_DELFIFO); /* flush FIFO */
return ret;
}
......
......@@ -469,7 +469,6 @@ static int pci171x_insn_read_ai(struct comedi_device *dev,
if (ret) {
outb(0, dev->iobase + PCI171x_CLRFIFO);
outb(0, dev->iobase + PCI171x_CLRINT);
data[n] = 0;
return ret;
}
......
......@@ -93,10 +93,8 @@ static int dyna_pci10xx_insn_read_ai(struct comedi_device *dev,
udelay(10);
ret = comedi_timeout(dev, s, insn, dyna_pci10xx_ai_eoc, 0);
if (ret) {
data[n] = 0;
if (ret)
break;
}
/* read data */
d = inw_p(dev->iobase);
......
......@@ -215,11 +215,8 @@ static int icp_multi_insn_read_ai(struct comedi_device *dev,
/* Wait for conversion to complete, or get fed up waiting */
ret = comedi_timeout(dev, s, insn, icp_multi_ai_eoc, 0);
if (ret) {
/* Clear data received */
data[n] = 0;
if (ret)
break;
}
data[n] =
(readw(devpriv->io_addr + ICP_MULTI_AI) >> 4) & 0x0fff;
......
......@@ -196,7 +196,6 @@ static int pcl816_ai_insn_read(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pcl816_ai_eoc, 0);
if (ret) {
data[0] = 0;
/* clear INT (conversion end) flag */
outb(0, dev->iobase + PCL816_CLRINT);
return ret;
......
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