From: H Hartley Sweeten Date: Wed, 5 Nov 2014 17:31:34 +0000 (-0700) Subject: staging: comedi: amplc_pci230: use comedi_async 'scans_done' to detect AI EOA X-Git-Tag: omap-for-v3.19/fixes-rc1~73^2~366 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6de95f467073aa0913de9bace18946c51283826;p=pandora-kernel.git staging: comedi: amplc_pci230: use comedi_async 'scans_done' to detect AI EOA Remove the private data member 'ai_scan_count' and use the comedi_async 'scans_done' member to detect the analog input end-of-acquisition. Use the comedi_nsamples_left() helper to work out the number of 'wake' samples in pci230_ai_update_fifo_trigger_level() and the number of 'todo' samples actually added to the async buffer in pci230_handle_ai(). Remove the unnecessary COMEDI_CB_OVERFLOW event for the hardware FIFO overflow error. The COMEDI_CB_ERROR event will terminate the command. comedi_buf_write_samples() can fail if the async buffer does not have room for the sample. The it will set the COMEDI_CB_OVERFLOW event and return 0. Detect this and quit trying to read and add more samples. The event will terminate the command. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed