From 1dc6e72903f6dbefd79ea2e9ce9c9e536e4e695b Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 26 Jan 2015 16:17:20 -0700 Subject: [PATCH] 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-format-patch failed