From: H Hartley Sweeten Date: Fri, 5 Sep 2014 16:25:49 +0000 (-0700) Subject: staging: comedi: adl_pci9118: no need to reset ai FIFO after (*insn_read) X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=91ed3f750e10b785878a962637b7c360e61070df;p=deliverable%2Flinux.git staging: comedi: adl_pci9118: no need to reset ai FIFO after (*insn_read) The analog input FIFO is reset at the start of every (*insn_read) and (*do_cmd) operation. It's also reset for the analog input (*cancel). There's no reason to reset the FIFO if an (*insn_read) times out or after all the samples have been acquired. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index c90afdfd76ca..5743960f0928 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -542,10 +542,8 @@ static int pci9118_insn_read_ai(struct comedi_device *dev, pci9118_ai_start_conv(dev); ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0); - if (ret) { - pci9118_ai_reset_fifo(dev); + if (ret) return ret; - } val = inl(dev->iobase + PCI9118_AI_FIFO_REG); if (s->maxdata == 0xffff) @@ -554,9 +552,7 @@ static int pci9118_insn_read_ai(struct comedi_device *dev, data[n] = (val >> 4) & 0xfff; } - pci9118_ai_reset_fifo(dev); return n; - } static void interrupt_pci9118_ai_mode4_switch(struct comedi_device *dev)