aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-06 15:04:35 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-06 15:04:35 -0400
commitd87dbede030d17770aa6a6170e70ab6f8044e5ae (patch)
treee3d8920485750da042628fe0fe1369c3effbf73b /drivers/isdn
parent8f4aff6cb178b0a580ee206e7cca63e2d31f4a4e (diff)
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>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/act2000/act2000_isa.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c
index 3014495b7ff7..3cac23739344 100644
--- a/drivers/isdn/act2000/act2000_isa.c
+++ b/drivers/isdn/act2000/act2000_isa.c
@@ -16,8 +16,6 @@
16#include "act2000_isa.h" 16#include "act2000_isa.h"
17#include "capi.h" 17#include "capi.h"
18 18
19static act2000_card *irq2card_map[16];
20
21/* 19/*
22 * Reset Controller, then try to read the Card's signature. 20 * Reset Controller, then try to read the Card's signature.
23 + Return: 21 + Return:
@@ -65,14 +63,9 @@ act2000_isa_detect(unsigned short portbase)
65static irqreturn_t 63static irqreturn_t
66act2000_isa_interrupt(int irq, void *dev_id) 64act2000_isa_interrupt(int irq, void *dev_id)
67{ 65{
68 act2000_card *card = irq2card_map[irq]; 66 act2000_card *card = dev_id;
69 u_char istatus; 67 u_char istatus;
70 68
71 if (!card) {
72 printk(KERN_WARNING
73 "act2000: Spurious interrupt!\n");
74 return IRQ_NONE;
75 }
76 istatus = (inb(ISA_PORT_ISR) & 0x07); 69 istatus = (inb(ISA_PORT_ISR) & 0x07);
77 if (istatus & ISA_ISR_OUT) { 70 if (istatus & ISA_ISR_OUT) {
78 /* RX fifo has data */ 71 /* RX fifo has data */
@@ -139,17 +132,15 @@ int
139act2000_isa_config_irq(act2000_card * card, short irq) 132act2000_isa_config_irq(act2000_card * card, short irq)
140{ 133{
141 if (card->flags & ACT2000_FLAGS_IVALID) { 134 if (card->flags & ACT2000_FLAGS_IVALID) {
142 free_irq(card->irq, NULL); 135 free_irq(card->irq, card);
143 irq2card_map[card->irq] = NULL;
144 } 136 }
145 card->flags &= ~ACT2000_FLAGS_IVALID; 137 card->flags &= ~ACT2000_FLAGS_IVALID;
146 outb(ISA_COR_IRQOFF, ISA_PORT_COR); 138 outb(ISA_COR_IRQOFF, ISA_PORT_COR);
147 if (!irq) 139 if (!irq)
148 return 0; 140 return 0;
149 141
150 if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) { 142 if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
151 card->irq = irq; 143 card->irq = irq;
152 irq2card_map[card->irq] = card;
153 card->flags |= ACT2000_FLAGS_IVALID; 144 card->flags |= ACT2000_FLAGS_IVALID;
154 printk(KERN_WARNING 145 printk(KERN_WARNING
155 "act2000: Could not request irq %d\n",irq); 146 "act2000: Could not request irq %d\n",irq);
@@ -188,10 +179,9 @@ act2000_isa_release(act2000_card * card)
188 unsigned long flags; 179 unsigned long flags;
189 180
190 spin_lock_irqsave(&card->lock, flags); 181 spin_lock_irqsave(&card->lock, flags);
191 if (card->flags & ACT2000_FLAGS_IVALID) { 182 if (card->flags & ACT2000_FLAGS_IVALID)
192 free_irq(card->irq, NULL); 183 free_irq(card->irq, card);
193 irq2card_map[card->irq] = NULL; 184
194 }
195 card->flags &= ~ACT2000_FLAGS_IVALID; 185 card->flags &= ~ACT2000_FLAGS_IVALID;
196 if (card->flags & ACT2000_FLAGS_PVALID) 186 if (card->flags & ACT2000_FLAGS_PVALID)
197 release_region(card->port, ISA_REGION); 187 release_region(card->port, ISA_REGION);