Use the recently added sample manipulation helpers to remove the hardcoded
assumption of the sample size.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/* figure out how many points to read */
num_bytes = devpriv->dma_transfer_size - get_dma_residue(channel);
- num_samples = num_bytes / sizeof(short);
+ num_samples = comedi_bytes_to_samples(s, num_bytes);
/* if we only need some of the points */
if (cmd->stop_src == TRIG_COUNT && devpriv->count < num_samples)