diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-04-22 18:35:12 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-23 10:41:45 -0700 |
commit | f05ffb6e12bcfcce5bb6c8eadbabe3b7ebe8f7db (patch) | |
tree | 6b65a1abc72c30a6e3b29c35367f3ed209e1618e /drivers/staging | |
parent | 77630119ba0d64ddbe1c839adfd05483d403a0ac (diff) | |
download | linux-f05ffb6e12bcfcce5bb6c8eadbabe3b7ebe8f7db.tar.bz2 |
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/comedi/drivers/das800.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c index 78e913e3dfe3..1260ebacca18 100644 --- a/drivers/staging/comedi/drivers/das800.c +++ b/drivers/staging/comedi/drivers/das800.c @@ -737,22 +737,14 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it) } dev->board_ptr = das800_boards + board; thisboard = comedi_board(dev); + dev->board_name = thisboard->name; - /* 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; - } + if (irq > 1 && irq <= 7) { + ret = request_irq(irq, das800_interrupt, 0, dev->board_name, + dev); + if (ret == 0) + dev->irq = irq; } - dev->irq = irq; - - dev->board_name = thisboard->name; ret = comedi_alloc_subdevices(dev, 3); if (ret) |