aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH Hartley Sweeten <[email protected]>2014-11-10 17:57:56 -0700
committerGreg Kroah-Hartman <[email protected]>2014-11-26 15:31:45 -0800
commitf6266a41d820feaa7b7febe122b285e336e40bfd (patch)
tree5c75a83910edfb0121a25b531f5d06e0f01f5032
parente57bfa673c3056747f8014b956e6fbed02f917d5 (diff)
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: H Hartley Sweeten <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/comedi/drivers/adl_pci9118.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c
index b527748658f0..498e0c7775e5 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -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