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>
This commit is contained in:
H Hartley Sweeten 2012-09-24 13:24:12 -07:00 committed by Greg Kroah-Hartman
parent b7047895b9
commit 8c7e4277c1
1 changed files with 8 additions and 15 deletions

View File

@ -2503,25 +2503,18 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
if (ret)
return ret;
if (pcidev->irq) {
ret = request_irq(pcidev->irq, s626_irq_handler, IRQF_SHARED,
dev->board_name, dev);
if (ret == 0)
dev->irq = pcidev->irq;
}
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,
dev->board_name, dev);
if (ret < 0) {
printk(KERN_ERR " irq not available\n");
dev->irq = 0;
}
}
s = dev->subdevices + 0;
/* analog input subdevice */
dev->read_subdev = s;