staging: comedi: ni_pcimio: tidy up the irq request
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 3 Dec 2013 19:07:25 +0000 (12:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Dec 2013 23:25:31 +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_pcimio.c

index 1166c45da49e3d0a068271b60ca64cc4afe045c8..ec4fa3d839c45452fe1c1570a522def58efe7379 100644 (file)
@@ -1469,6 +1469,7 @@ static int pcimio_auto_attach(struct comedi_device *dev,
        struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        const struct ni_board_struct *board = NULL;
        struct ni_private *devpriv;
+       unsigned int irq;
        int ret;
 
        if (context < ARRAY_SIZE(ni_boards))
@@ -1530,18 +1531,12 @@ static int pcimio_auto_attach(struct comedi_device *dev,
        if (board->reg_type == ni_reg_6143)
                init_6143(dev);
 
-       dev->irq = mite_irq(devpriv->mite);
-
-       if (dev->irq == 0) {
-               pr_warn("unknown irq (bad)\n");
-       } else {
-               pr_debug("( irq = %u )\n", dev->irq);
-               ret = request_irq(dev->irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
-                                 DRV_NAME, dev);
-               if (ret < 0) {
-                       pr_warn("irq not available\n");
-                       dev->irq = 0;
-               }
+       irq = mite_irq(devpriv->mite);
+       if (irq) {
+               ret = request_irq(irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
+                                 dev->board_name, dev);
+               if (ret == 0)
+                       dev->irq = irq;
        }
 
        ret = ni_E_init(dev);