Commit 8c7e4277 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b7047895
...@@ -2503,25 +2503,18 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) ...@@ -2503,25 +2503,18 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
if (ret) if (ret)
return ret; return ret;
ret = comedi_alloc_subdevices(dev, 6); if (pcidev->irq) {
if (ret) ret = request_irq(pcidev->irq, s626_irq_handler, IRQF_SHARED,
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,
dev->board_name, dev); dev->board_name, dev);
if (ret < 0) { if (ret == 0)
printk(KERN_ERR " irq not available\n"); dev->irq = pcidev->irq;
dev->irq = 0;
}
} }
ret = comedi_alloc_subdevices(dev, 6);
if (ret)
return ret;
s = dev->subdevices + 0; s = dev->subdevices + 0;
/* analog input subdevice */ /* analog input subdevice */
dev->read_subdev = s; dev->read_subdev = s;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment