From: H Hartley Sweeten Date: Tue, 22 Mar 2016 18:10:43 +0000 (-0700) Subject: staging: comedi: ni_660x: disable interrupts when detaching driver X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78d514fa4cc0f195e060b7918d3548b63d27050f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: ni_660x: disable interrupts when detaching driver Make sure the interrupts are disabled before freeing the irq. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 2440cb6a72c7..c71dae8da804 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -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);