]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/sc/init.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / drivers / isdn / sc / init.c
index 06c9872e8c6a5c5b503117d86fdd05dbd3286e65..dd0acd06750b2fd614e242e83e6df125cbfb7338 100644 (file)
@@ -35,12 +35,6 @@ module_param_array(irq, int, NULL, 0);
 module_param_array(ram, int, NULL, 0);
 module_param(do_reset, bool, 0);
 
-extern irqreturn_t interrupt_handler(int, void *);
-extern int sndpkt(int, int, int, struct sk_buff *);
-extern int command(isdn_ctrl *);
-extern int indicate_status(int, int, ulong, char*);
-extern int reset(int);
-
 static int identify_board(unsigned long, unsigned int);
 
 static int __init sc_init(void)
@@ -271,14 +265,13 @@ static int __init sc_init(void)
                 * Horray! We found a board, Make sure we can register
                 * it with ISDN4Linux
                 */
-               interface = kmalloc(sizeof(isdn_if), GFP_KERNEL);
+               interface = kzalloc(sizeof(isdn_if), GFP_KERNEL);
                if (interface == NULL) {
                        /*
                         * Oops, can't malloc isdn_if
                         */
                        continue;
                }
-               memset(interface, 0, sizeof(isdn_if));
 
                interface->owner = THIS_MODULE;
                interface->hl_hdrlen = 0;
@@ -294,7 +287,7 @@ static int __init sc_init(void)
                /*
                 * Allocate the board structure
                 */
-               sc_adapter[cinst] = kmalloc(sizeof(board), GFP_KERNEL);
+               sc_adapter[cinst] = kzalloc(sizeof(board), GFP_KERNEL);
                if (sc_adapter[cinst] == NULL) {
                        /*
                         * Oops, can't alloc memory for the board
@@ -302,7 +295,6 @@ static int __init sc_init(void)
                        kfree(interface);
                        continue;
                }
-               memset(sc_adapter[cinst], 0, sizeof(board));
                spin_lock_init(&sc_adapter[cinst]->lock);
 
                if(!register_isdn(interface)) {
@@ -326,7 +318,7 @@ static int __init sc_init(void)
                /*
                 * Allocate channels status structures
                 */
-               sc_adapter[cinst]->channel = kmalloc(sizeof(bchan) * channels, GFP_KERNEL);
+               sc_adapter[cinst]->channel = kzalloc(sizeof(bchan) * channels, GFP_KERNEL);
                if (sc_adapter[cinst]->channel == NULL) {
                        /*
                         * Oops, can't alloc memory for the channels
@@ -336,14 +328,14 @@ static int __init sc_init(void)
                        kfree(sc_adapter[cinst]);
                        continue;
                }
-               memset(sc_adapter[cinst]->channel, 0, sizeof(bchan) * channels);
 
                /*
                 * Lock down the hardware resources
                 */
                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 */
@@ -413,7 +405,7 @@ static void __exit sc_exit(void)
                /*
                 * Release the IRQ
                 */
-               FREE_IRQ(sc_adapter[i]->interrupt, NULL);
+               free_irq(sc_adapter[i]->interrupt, NULL);
 
                /*
                 * Reset for a clean start