staging: comedi: ni_pcidio: tidy up the irq request
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 3 Dec 2013 19:07:26 +0000 (12:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 23:25:32 +0000 (15:25 -0800)
The irq is only needed to support async commands. Tidy up the
code that does the request_irq() and remove the noise.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_pcidio.c

index 313b436617bb301a9713a893fb6759d31d17fa26..645a4d80e608dba9bad139298a80ba47077149e5 100644 (file)
@@ -990,7 +990,6 @@ static int nidio_auto_attach(struct comedi_device *dev,
        if (devpriv->di_mite_ring == NULL)
                return -ENOMEM;
 
-       irq = mite_irq(devpriv->mite);
        if (board->uses_firmware) {
                ret = pci_6534_upload_firmware(dev);
                if (ret < 0)
@@ -1033,12 +1032,13 @@ static int nidio_auto_attach(struct comedi_device *dev,
                devpriv->mite->daq_io_addr +
                Master_DMA_And_Interrupt_Control);
 
-       ret = request_irq(irq, nidio_interrupt, IRQF_SHARED,
-                               "ni_pcidio", dev);
-       if (ret < 0)
-               dev_warn(dev->class_dev, "irq not available\n");
-
-       dev->irq = irq;
+       irq = mite_irq(devpriv->mite);
+       if (irq) {
+               ret = request_irq(irq, nidio_interrupt, IRQF_SHARED,
+                                 dev->board_name, dev);
+               if (ret == 0)
+                       dev->irq = irq;
+       }
 
        return 0;
 }