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

Commit 1c937c13 authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

staging/comedi/das16: Make timer initialization unconditional



With timer initialization made unconditional, there is no reason to
make del_timer_sync() calls conditionally, there by removing the test
of the .data field.

Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4b26706c
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -934,6 +934,9 @@ static void das16_alloc_dma(struct comedi_device *dev, unsigned int dma_chan)
{
	struct das16_private_struct *devpriv = dev->private;

	setup_timer(&devpriv->timer, das16_timer_interrupt,
		    (unsigned long)dev);

	/* only DMA channels 3 and 1 are valid */
	if (!(dma_chan == 1 || dma_chan == 3))
		return;
@@ -941,10 +944,6 @@ static void das16_alloc_dma(struct comedi_device *dev, unsigned int dma_chan)
	/* DMA uses two buffers */
	devpriv->dma = comedi_isadma_alloc(dev, 2, dma_chan, dma_chan,
					   DAS16_DMA_SIZE, COMEDI_ISADMA_READ);
	if (devpriv->dma) {
		setup_timer(&devpriv->timer, das16_timer_interrupt,
			    (unsigned long)dev);
	}
}

static void das16_free_dma(struct comedi_device *dev)
@@ -952,7 +951,6 @@ static void das16_free_dma(struct comedi_device *dev)
	struct das16_private_struct *devpriv = dev->private;

	if (devpriv) {
		if (devpriv->timer.data)
		del_timer_sync(&devpriv->timer);
		comedi_isadma_free(devpriv->dma);
	}