From ceb41be712b68fac4ac834120a80fc3cb8e5ac37 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 12 Jan 2015 10:56:04 -0700 Subject: [PATCH] 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-format-patch failed