mirror of https://gitee.com/openkylin/linux.git
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: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
22ca19d93d
commit
dbd446fc7a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue