]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: s626: cleanup request_irq in s626_attach_pci()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 24 Sep 2012 20:24:12 +0000 (13:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Sep 2012 16:37:31 +0000 (09:37 -0700)
Only set dev->irq if request_irq is successfull.

Remove the kernel message 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/s626.c

index 61bb8ab05786c4cff7b5bb0b9b79b56534b529e7..4ad3f27b07c491dc7eb838d186b716b4642cc1d2 100644 (file)
@@ -2503,25 +2503,18 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
        if (ret)
                return ret;
 
-       ret = comedi_alloc_subdevices(dev, 6);
-       if (ret)
-               return ret;
-
-       dev->irq = pcidev->irq;
-
-       /* set up interrupt handler */
-       if (dev->irq == 0) {
-               printk(KERN_ERR " unknown irq (bad)\n");
-       } else {
-               ret = request_irq(dev->irq, s626_irq_handler, IRQF_SHARED,
+       if (pcidev->irq) {
+               ret = request_irq(pcidev->irq, s626_irq_handler, IRQF_SHARED,
                                  dev->board_name, dev);
 
-               if (ret < 0) {
-                       printk(KERN_ERR " irq not available\n");
-                       dev->irq = 0;
-               }
+               if (ret == 0)
+                       dev->irq = pcidev->irq;
        }
 
+       ret = comedi_alloc_subdevices(dev, 6);
+       if (ret)
+               return ret;
+
        s = dev->subdevices + 0;
        /* analog input subdevice */
        dev->read_subdev = s;