From: H Hartley Sweeten Date: Mon, 12 Jan 2015 17:56:04 +0000 (-0700) Subject: staging: comedi: pcl816: fix short DMA transactions X-Git-Tag: fixes-v4.0-rc1~99^2~412 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceb41be712b68fac4ac834120a80fc3cb8e5ac37;p=pandora-kernel.git staging: comedi: pcl816: fix short DMA transactions 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 async buffer. Add a 'size' member to the DMA descriptor and initialize it with the actual size of the DMA transfer. Use that in interrupt and ai subdevice (*poll) function to return the proper number of samples. Use the comedi_bytes_to_samples() helper to convert the byte size to comedi samples in the interrupt handler. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed