staging: comedi: das16: remove unnecessary test in das16_interrupt()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 29 Jul 2013 21:03:11 +0000 (14:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2013 00:37:56 +0000 (17:37 -0700)
The timer is only started by the ai subdevice in das16_cmd_exec()
and this function can only be called if the device is attached.

Remove the unnecessary sanity check.

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/das16.c

index cd2fa4cafc441f100dd839a09cc275bf09110688..df7bf1e26c5ed58b3c7c16e64d1ec4552b42d1c9 100644 (file)
@@ -350,21 +350,14 @@ static int disable_dma_on_even(struct comedi_device *dev)
 static void das16_interrupt(struct comedi_device *dev)
 {
        struct das16_private_struct *devpriv = dev->private;
-       unsigned long dma_flags, spin_flags;
        struct comedi_subdevice *s = dev->read_subdev;
-       struct comedi_async *async;
-       struct comedi_cmd *cmd;
+       struct comedi_async *async = s->async;
+       struct comedi_cmd *cmd = &async->cmd;
+       unsigned long spin_flags;
+       unsigned long dma_flags;
        int num_bytes, residue;
        int buffer_index;
 
-       if (!dev->attached) {
-               comedi_error(dev, "premature interrupt");
-               return;
-       }
-       /*  initialize async here to make sure it is not NULL */
-       async = s->async;
-       cmd = &async->cmd;
-
        spin_lock_irqsave(&dev->spinlock, spin_flags);
        if ((devpriv->ctrl_reg & DMA_ENABLE) == 0) {
                spin_unlock_irqrestore(&dev->spinlock, spin_flags);