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 <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/staging/comedi/drivers/pcl816.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl816.c 
b/drivers/staging/comedi/drivers/pcl816.c
index 4293edc..0337a13 100644
--- a/drivers/staging/comedi/drivers/pcl816.c
+++ b/drivers/staging/comedi/drivers/pcl816.c
@@ -92,7 +92,6 @@ static const struct comedi_lrange range_pcl816 = {
 
 struct pcl816_board {
        const char *name;
-       unsigned int IRQbits;
        int ai_maxdata;
        int ao_maxdata;
 };
@@ -100,12 +99,10 @@ struct pcl816_board {
 static const struct pcl816_board boardtypes[] = {
        {
                .name           = "pcl816",
-               .IRQbits        = 0x00fc,
                .ai_maxdata     = 0xffff,
                .ao_maxdata     = 0xffff,
        }, {
                .name           = "pcl814b",
-               .IRQbits        = 0x00fc,
                .ai_maxdata     = 0x3fff,
                .ao_maxdata     = 0x3fff,
        },
@@ -850,7 +847,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)
-- 
1.8.5.2

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to