Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6266a41 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: adl_pci9118: use comedi_bytes_to_samples()



Remove the assumption of the sample size by using the comedi_bytes_to_samples()
helper function to convert the number of bytes to the number of samples.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e57bfa67
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -607,11 +607,9 @@ static void interrupt_pci9118_ai_dma(struct comedi_device *dev,
	struct pci9118_private *devpriv = dev->private;
	struct comedi_cmd *cmd = &s->async->cmd;
	struct pci9118_dmabuf *dmabuf = &devpriv->dmabuf[devpriv->dma_actbuf];
	unsigned int nsamples;
	unsigned int nsamples = comedi_bytes_to_samples(s, dmabuf->use_size);
	unsigned int next_dma_buf;

	nsamples = dmabuf->use_size >> 1;	/* number of received samples */

	if (devpriv->dma_doublebuf) {	/*
					 * switch DMA buffers if is used
					 * double buffering