From: H Hartley Sweeten Date: Mon, 12 Jan 2015 17:55:59 +0000 (-0700) Subject: staging: comedi: pcl818: fix pcl818_handle_dma() for short DMA transaction X-Git-Tag: omap-for-v4.1/prcm-dts-mfd-syscon-fix~83^2~417 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c53093a1dea755f5ab9598d57b78f9a9444262d;p=pandora-kernel.git staging: comedi: pcl818: fix pcl818_handle_dma() for short DMA transaction Currently this function always transfers the full DMA buffer to the comedi async buffer. When the cmd->stop_src == TRIG_COUNT the last DMA transfer might be smaller than the buffer size. This results in invalid data being added to the asunc buffer. Add a 'size' member to the DMA descriptor and initialize it with the actual size of the DMA transfer. Use that in pcl818_handle_dma() to return the proper number of samples. Use the comedi_bytes_to_samples() helper to convert the byte size to comedi samples. Remove the unnecessary 'bufptr' local variable. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed