isdn/sc: irq handler clean
authorJeff Garzik <jeff@garzik.org>
Fri, 19 Oct 2007 23:31:27 +0000 (19:31 -0400)
committerJeff Garzik <jeff@garzik.org>
Tue, 23 Oct 2007 23:53:16 +0000 (19:53 -0400)
* pass card number to irq handler

* use card number in irq handler to avoid looping through each adapter

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/isdn/sc/init.c
drivers/isdn/sc/interrupt.c

index d09c854cfac7f819721cc91c5624c1bbc6a67c2a..dd0acd06750b2fd614e242e83e6df125cbfb7338 100644 (file)
@@ -334,7 +334,8 @@ static int __init sc_init(void)
                 */
                sc_adapter[cinst]->interrupt = irq[b];
                if (request_irq(sc_adapter[cinst]->interrupt, interrupt_handler,
-                               IRQF_DISABLED, interface->id, NULL))
+                               IRQF_DISABLED, interface->id,
+                               (void *)(unsigned long) cinst))
                {
                        kfree(sc_adapter[cinst]->channel);
                        indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL);      /* Fix me */
index bef7963cdd022ebca70e7458621f1f317c401014..485be8b1e1b33bef2bd7e3af8fab2066d3687ec3 100644 (file)
 #include "card.h"
 #include <linux/interrupt.h>
 
-static int get_card_from_irq(int irq)
-{
-       int i;
-
-       for(i = 0 ; i < cinst ; i++) {
-               if(sc_adapter[i]->interrupt == irq)
-                       return i;
-       }
-       return -1;
-}
-
 /*
  * 
  */
-irqreturn_t interrupt_handler(int interrupt, void *cardptr)
+irqreturn_t interrupt_handler(int dummy, void *card_inst)
 {
 
        RspMessage rcvmsg;
        int channel;
-       int card;
-
-       card = get_card_from_irq(interrupt);
+       int card = (int)(unsigned long) card_inst;
 
        if(!IS_VALID_CARD(card)) {
                pr_debug("Invalid param: %d is not a valid card id\n", card);