Skip to content

Commit d87dbed

Browse files
author
Jeff Garzik
committed
drivers/isdn/act2000: kill irq2card_map
Eliminate irq->card lookup table, by properly passing the card pointer via request_irq() like other drivers. Signed-off-by: Jeff Garzik <jeff@garzik.org>
1 parent 8f4aff6 commit d87dbed

1 file changed

Lines changed: 6 additions & 16 deletions

File tree

‎drivers/isdn/act2000/act2000_isa.c‎

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
#include "act2000_isa.h"
1717
#include "capi.h"
1818

19-
static act2000_card *irq2card_map[16];
20-
2119
/*
2220
* Reset Controller, then try to read the Card's signature.
2321
+ Return:
@@ -65,14 +63,9 @@ act2000_isa_detect(unsigned short portbase)
6563
static irqreturn_t
6664
act2000_isa_interrupt(int irq, void *dev_id)
6765
{
68-
act2000_card *card = irq2card_map[irq];
66+
act2000_card *card = dev_id;
6967
u_char istatus;
7068

71-
if (!card) {
72-
printk(KERN_WARNING
73-
"act2000: Spurious interrupt!\n");
74-
return IRQ_NONE;
75-
}
7669
istatus = (inb(ISA_PORT_ISR) & 0x07);
7770
if (istatus & ISA_ISR_OUT) {
7871
/* RX fifo has data */
@@ -139,17 +132,15 @@ int
139132
act2000_isa_config_irq(act2000_card * card, short irq)
140133
{
141134
if (card->flags & ACT2000_FLAGS_IVALID) {
142-
free_irq(card->irq, NULL);
143-
irq2card_map[card->irq] = NULL;
135+
free_irq(card->irq, card);
144136
}
145137
card->flags &= ~ACT2000_FLAGS_IVALID;
146138
outb(ISA_COR_IRQOFF, ISA_PORT_COR);
147139
if (!irq)
148140
return 0;
149141

150-
if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) {
142+
if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
151143
card->irq = irq;
152-
irq2card_map[card->irq] = card;
153144
card->flags |= ACT2000_FLAGS_IVALID;
154145
printk(KERN_WARNING
155146
"act2000: Could not request irq %d\n",irq);
@@ -188,10 +179,9 @@ act2000_isa_release(act2000_card * card)
188179
unsigned long flags;
189180

190181
spin_lock_irqsave(&card->lock, flags);
191-
if (card->flags & ACT2000_FLAGS_IVALID) {
192-
free_irq(card->irq, NULL);
193-
irq2card_map[card->irq] = NULL;
194-
}
182+
if (card->flags & ACT2000_FLAGS_IVALID)
183+
free_irq(card->irq, card);
184+
195185
card->flags &= ~ACT2000_FLAGS_IVALID;
196186
if (card->flags & ACT2000_FLAGS_PVALID)
197187
release_region(card->port, ISA_REGION);

0 commit comments

Comments
 (0)