staging: comedi: pcl816: fix DMA 'bytes' calculation
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 27 May 2014 17:30:58 +0000 (10:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 21:28:54 +0000 (14:28 -0700)
The calculation for the total number of bytes in the DMA transfer
is incorrect. Fix it.

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>
drivers/staging/comedi/drivers/pcl816.c

index 3742f5f78fc636a1ef777c9fbb5dfa517d47d10d..9c1b963a0bede9b60803a32f8b66e3cda9290c6a 100644 (file)
@@ -164,9 +164,7 @@ static void pcl816_ai_setup_dma(struct comedi_device *dev,
        bytes = devpriv->hwdmasize;
        if (cmd->stop_src == TRIG_COUNT) {
                /*  how many */
-               bytes = s->async->cmd.chanlist_len *
-               s->async->cmd.chanlist_len *
-               sizeof(short);
+               bytes = cmd->stop_arg * cmd->chanlist_len * sizeof(short);
 
                /*  how many DMA pages we must fill */
                devpriv->dma_runs_to_end = bytes / devpriv->hwdmasize;