diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-02-19 10:11:22 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-21 12:39:38 -0800 |
commit | e5f376df8b13cf09220a8003469b10a9b8095d3c (patch) | |
tree | b2cbafdad7d6abe0c9c9f6dbbd49c2bf8712ee2f | |
parent | 31baee58a6c797f399e8b673e5db96a7aeccef44 (diff) |
staging: comedi: pcl816: clarify irq request in pcl816_attach()
All the board types can use IRQ 2-7 for async command support. Remove
the 'IRQbits', which is a mask of the valid IRQs, from the boardinfo
and refactor pcl816_attach().
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>
-rw-r--r-- | drivers/staging/comedi/drivers/pcl816.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c index b76e9d6f9386..cfda332ef715 100644 --- a/drivers/staging/comedi/drivers/pcl816.c +++ b/drivers/staging/comedi/drivers/pcl816.c @@ -87,7 +87,6 @@ static const struct comedi_lrange range_pcl816 = { struct pcl816_board { const char *name; - unsigned int IRQbits; int ai_maxdata; int ao_maxdata; int ai_chanlist; @@ -96,13 +95,11 @@ struct pcl816_board { static const struct pcl816_board boardtypes[] = { { .name = "pcl816", - .IRQbits = 0x00fc, .ai_maxdata = 0xffff, .ao_maxdata = 0xffff, .ai_chanlist = 1024, }, { .name = "pcl814b", - .IRQbits = 0x00fc, .ai_maxdata = 0x3fff, .ao_maxdata = 0x3fff, .ai_chanlist = 1024, @@ -827,7 +824,8 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (!devpriv) return -ENOMEM; - if ((1 << it->options[1]) & board->IRQbits) { + /* we can use IRQ 2-7 for async command support */ + if (it->options[1] >= 2 && it->options[1] <= 7) { ret = request_irq(it->options[1], interrupt_pcl816, 0, dev->board_name, dev); if (ret == 0) |