From: H Hartley Sweeten Date: Mon, 26 Jan 2015 23:17:20 +0000 (-0700) Subject: staging: comedi: das16: fix DMA size for short transfers X-Git-Tag: fixes-v4.0-rc1~99^2~121 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dc6e72903f6dbefd79ea2e9ce9c9e536e4e695b;p=pandora-kernel.git staging: comedi: das16: fix DMA size for short transfers Currently this driver alwasy programs the DMA transfer to be the allocated size of the DMA buffer. When the async command 'stop_src' is TRIG_COUNT its possible (likely) for the last transfer to be less than the buffer size. Introduce a helper function, das16_ai_setup_dma(), to calculate the actual size of the DMA transfer based on the number of samples remaining and the number of unread samples. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed