diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-19 19:30:28 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-23 19:53:16 -0400 |
commit | 246f93f5cc0d4116cadf33ad1c8ae7ac08e9b1c7 (patch) | |
tree | 05cfcb3b73c3de7b277295a9ca89db8cfb4bebd2 /drivers | |
parent | d12341f9f2b7cc38c699c2af3a9f17eb39b64b17 (diff) |
isdn/act2000: fix major bug. clean irq handler.
* invert sense of request_irq() test. otherwise we will always fail,
when IRQ is available.
* no need to use 'irq' function arg, its stored in a data struct already
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/isdn/act2000/act2000_isa.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 819ea85576a3..1bd8960ead33 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c | |||
@@ -61,7 +61,7 @@ act2000_isa_detect(unsigned short portbase) | |||
61 | } | 61 | } |
62 | 62 | ||
63 | static irqreturn_t | 63 | static irqreturn_t |
64 | act2000_isa_interrupt(int irq, void *dev_id) | 64 | act2000_isa_interrupt(int dummy, void *dev_id) |
65 | { | 65 | { |
66 | act2000_card *card = dev_id; | 66 | act2000_card *card = dev_id; |
67 | u_char istatus; | 67 | u_char istatus; |
@@ -80,7 +80,7 @@ act2000_isa_interrupt(int irq, void *dev_id) | |||
80 | printk(KERN_WARNING "act2000: errIRQ\n"); | 80 | printk(KERN_WARNING "act2000: errIRQ\n"); |
81 | } | 81 | } |
82 | if (istatus) | 82 | if (istatus) |
83 | printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", irq, istatus); | 83 | printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, istatus); |
84 | return IRQ_HANDLED; | 84 | return IRQ_HANDLED; |
85 | } | 85 | } |
86 | 86 | ||
@@ -131,6 +131,8 @@ act2000_isa_enable_irq(act2000_card * card) | |||
131 | int | 131 | int |
132 | act2000_isa_config_irq(act2000_card * card, short irq) | 132 | act2000_isa_config_irq(act2000_card * card, short irq) |
133 | { | 133 | { |
134 | int old_irq; | ||
135 | |||
134 | if (card->flags & ACT2000_FLAGS_IVALID) { | 136 | if (card->flags & ACT2000_FLAGS_IVALID) { |
135 | free_irq(card->irq, card); | 137 | free_irq(card->irq, card); |
136 | } | 138 | } |
@@ -139,8 +141,10 @@ act2000_isa_config_irq(act2000_card * card, short irq) | |||
139 | if (!irq) | 141 | if (!irq) |
140 | return 0; | 142 | return 0; |
141 | 143 | ||
142 | if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) { | 144 | old_irq = card->irq; |
143 | card->irq = irq; | 145 | card->irq = irq; |
146 | if (request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) { | ||
147 | card->irq = old_irq; | ||
144 | card->flags |= ACT2000_FLAGS_IVALID; | 148 | card->flags |= ACT2000_FLAGS_IVALID; |
145 | printk(KERN_WARNING | 149 | printk(KERN_WARNING |
146 | "act2000: Could not request irq %d\n",irq); | 150 | "act2000: Could not request irq %d\n",irq); |