diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-09-24 13:24:12 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-09-26 09:37:31 -0700 |
commit | 8c7e4277c1197d31c0b34dbaf23e6edddb5978f7 (patch) | |
tree | fccd38d5a017f1dd9d111a2d13ffdd5983e38db6 /drivers/staging/comedi | |
parent | b7047895b9c9deee0b0f4cb2a0a788c189f985f2 (diff) |
staging: comedi: s626: cleanup request_irq in s626_attach_pci()
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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r-- | drivers/staging/comedi/drivers/s626.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index 61bb8ab05786..4ad3f27b07c4 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -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; |