staging: comedi: das800: allow attaching without interrupt support
Interrupts are only requires for the analog input async command support. Allow the driver to attach to the board if the request_irq() fails. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
77630119ba
commit
f05ffb6e12
1 changed files with 7 additions and 15 deletions
|
@ -737,23 +737,15 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
}
|
}
|
||||||
dev->board_ptr = das800_boards + board;
|
dev->board_ptr = das800_boards + board;
|
||||||
thisboard = comedi_board(dev);
|
thisboard = comedi_board(dev);
|
||||||
|
|
||||||
/* grab our IRQ */
|
|
||||||
if (irq == 1 || irq > 7) {
|
|
||||||
dev_err(dev->class_dev, "irq out of range\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
if (irq) {
|
|
||||||
if (request_irq(irq, das800_interrupt, 0, "das800", dev)) {
|
|
||||||
dev_err(dev->class_dev, "unable to allocate irq %u\n",
|
|
||||||
irq);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dev->irq = irq;
|
|
||||||
|
|
||||||
dev->board_name = thisboard->name;
|
dev->board_name = thisboard->name;
|
||||||
|
|
||||||
|
if (irq > 1 && irq <= 7) {
|
||||||
|
ret = request_irq(irq, das800_interrupt, 0, dev->board_name,
|
||||||
|
dev);
|
||||||
|
if (ret == 0)
|
||||||
|
dev->irq = irq;
|
||||||
|
}
|
||||||
|
|
||||||
ret = comedi_alloc_subdevices(dev, 3);
|
ret = comedi_alloc_subdevices(dev, 3);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue