staging: comedi: ni_660x: disable interrupts when detaching driver
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 22 Mar 2016 18:10:43 +0000 (11:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Make sure the interrupts are disabled before freeing the irq.

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

index 2440cb6a72c7428735ed55879e98f03b161165d9..c71dae8da804b3bf450387276ef817c9eb9f70dd 100644 (file)
@@ -1064,8 +1064,10 @@ static void ni_660x_detach(struct comedi_device *dev)
 {
        struct ni_660x_private *devpriv = dev->private;
 
-       if (dev->irq)
+       if (dev->irq) {
+               ni_660x_write(dev, 0, 0, NI660X_GLOBAL_INT_CFG);
                free_irq(dev->irq, dev);
+       }
        if (devpriv) {
                ni_gpct_device_destroy(devpriv->counter_dev);
                ni_660x_free_mite_rings(dev);