On 22/10/14 22:36, H Hartley Sweeten wrote:
Currently there are 3 exported methods to read sample data from the async buffer. 1) cfc_read_array_from_buffer() - a wrapper around comedi_read_array_from_buffer() 2) comedi_read_array_from_buffer() - reads multiple samples 3) comedi_buf_get() - reads a single sample In addition there are the exported functions comedi_buf_memcpy_{to,from}() that are only used internally to read/write data to/from the async buffer. Introduce a new generic helper function, comedi_buf_read_samples(), to read samples from the async buffer. Use this function to replace the three "read" methods above. Remove the exports from comedi_buf_memcpy_{to,from}() and tidy them up a bit. v2: fix patch 01/18 as suggested by Ian Abbott fix patch 09/18 as suggested by Ian Abbott H Hartley Sweeten (18): staging: comedi: comedi_buf: introduce comedi_buf_read_samples() staging: comedi: amplc_pci224: use comedi_buf_read_samples() staging: comedi: cb_pcidas: introduce cb_pcidas_ao_load_fifo() staging: comedi: cb_pcidas: introduce cb_pcidas64_ao_fill_buffer() staging: comedi: dt282x: introduce dt282x_ao_setup_dma() staging: comedi: comedi_fc.h: remove cfc_read_array_from_buffer() staging: comedi: comedi_buf: remove export of comedi_read_array_from_buffer() staging: comedi: comedi_buf: absorb comedi_read_array_from_buffer() staging: comedi: comedi_buf: make comedi_buf_read_samples() always return full samples staging: comedi: ni_mio_common: use comedi_buf_read_samples() staging: comedi: amplc_pci230: use comedi_buf_read_samples() staging: comedi: usbdux: use comedi_buf_read_samples() staging: comedi: usbduxsigma: use comedi_buf_read_samples() staging: comedi: comedi_buf: remove comedi_buf_get() staging: comedi: comedi_buf: dont't export comedi_buf_memcpy_from() staging: comedi: comedi_buf: don't export comedi_buf_memcpy_to() staging: comedi: comedi_buf: comedi_buf_memcpy_to() remove 'offset' param staging: comedi: comedi_buf: comedi_buf_memcpy_from() remove 'offset' param drivers/staging/comedi/comedi_buf.c | 70 +++++++++-------------- drivers/staging/comedi/comedidev.h | 9 +-- drivers/staging/comedi/drivers/amplc_pci224.c | 7 +-- drivers/staging/comedi/drivers/amplc_pci230.c | 17 +++--- drivers/staging/comedi/drivers/cb_pcidas.c | 54 +++++++----------- drivers/staging/comedi/drivers/cb_pcidas64.c | 79 +++++++++++++++----------- drivers/staging/comedi/drivers/comedi_fc.h | 7 --- drivers/staging/comedi/drivers/dt282x.c | 42 +++++++------- drivers/staging/comedi/drivers/ni_mio_common.c | 13 +---- drivers/staging/comedi/drivers/usbdux.c | 3 +- drivers/staging/comedi/drivers/usbduxsigma.c | 3 +- 11 files changed, 135 insertions(+), 169 deletions(-)
There's an issue with patch 01 that is resolved in patch 09, so not that big a deal.
Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx> -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@xxxxxxxxx> )=- -=( Web: http://www.mev.co.uk/ )=- _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel