summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-09-20 16:27:50 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-22 10:57:22 +0200
commit1c937c1390cc1ca95032e56b4ec8c4e32e54debe (patch)
tree6bc304a5722f5c9a42b9101f90bade500503986a /drivers/staging/comedi
parent4b26706c77ada60d92ca1846a7956298edcc78ea (diff)
downloadblackbird-obmc-linux-1c937c1390cc1ca95032e56b4ec8c4e32e54debe.tar.gz
blackbird-obmc-linux-1c937c1390cc1ca95032e56b4ec8c4e32e54debe.zip
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: Kees Cook <keescook@chromium.org> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/das16.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/staging/comedi/drivers/das16.c b/drivers/staging/comedi/drivers/das16.c
index 5d157951f63f..2b2a446af3f5 100644
--- a/drivers/staging/comedi/drivers/das16.c
+++ b/drivers/staging/comedi/drivers/das16.c
@@ -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,8 +951,7 @@ 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);
+ del_timer_sync(&devpriv->timer);
comedi_isadma_free(devpriv->dma);
}
}
OpenPOWER on IntegriCloud