]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: ni_labpc: allow board to attach without interrupt
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 22 Mar 2013 16:55:08 +0000 (09:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 18:42:59 +0000 (11:42 -0700)
If the interrupt is not available this driver will still work
with command support disabled for the analog input subdevice.

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_labpc.c

index 350ba0454bd6c0435fa27081ef5fb9fd87bd4347..a52647a901f64ad1e45e09ca560db0f07684ddcb 100644 (file)
@@ -1661,20 +1661,16 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase,
                devpriv->write_byte(devpriv->cmd6, dev->iobase + CMD6_REG);
        }
 
-       /* grab our IRQ */
        if (irq) {
                isr_flags = 0;
                if (board->bustype == pci_bustype ||
                    board->bustype == pcmcia_bustype)
                        isr_flags |= IRQF_SHARED;
-               if (request_irq(irq, labpc_interrupt, isr_flags,
-                               dev->board_name, dev)) {
-                       dev_err(dev->class_dev, "unable to allocate irq %u\n",
-                               irq);
-                       return -EINVAL;
-               }
+               ret = request_irq(irq, labpc_interrupt, isr_flags,
+                                 dev->board_name, dev);
+               if (ret == 0)
+                       dev->irq = irq;
        }
-       dev->irq = irq;
 
 #ifdef CONFIG_ISA_DMA_API
        /* grab dma channel */