X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fisdn%2Fsc%2Finit.c;h=150759a5cddf9a97f621ed495b1194399abce666;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=62b7acfad8a4fcd289b05735d1f51a21790c658e;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index 62b7acfad..150759a5c 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -35,7 +35,7 @@ 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 *, struct pt_regs *); +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*); @@ -98,13 +98,14 @@ static int __init sc_init(void) * Confirm the I/O Address with a test */ if(io[b] == 0) { - pr_debug("I/O Address 0x%x is in use.\n"); + pr_debug("I/O Address invalid.\n"); continue; } outb(0x18, io[b] + 0x400 * EXP_PAGE0); if(inb(io[b] + 0x400 * EXP_PAGE0) != 0x18) { - pr_debug("I/O Base 0x%x fails test\n"); + pr_debug("I/O Base 0x%x fails test\n", + io[b] + 0x400 * EXP_PAGE0); continue; } } @@ -158,8 +159,8 @@ static int __init sc_init(void) outb(0xFF, io[b] + RESET_OFFSET); msleep_interruptible(10000); } - pr_debug("RAM Base for board %d is 0x%x, %s probe\n", b, ram[b], - ram[b] == 0 ? "will" : "won't"); + pr_debug("RAM Base for board %d is 0x%lx, %s probe\n", b, + ram[b], ram[b] == 0 ? "will" : "won't"); if(ram[b]) { /* @@ -168,7 +169,7 @@ static int __init sc_init(void) * board model */ if(request_region(ram[b], SRAM_PAGESIZE, "sc test")) { - pr_debug("request_region for RAM base 0x%x succeeded\n", ram[b]); + pr_debug("request_region for RAM base 0x%lx succeeded\n", ram[b]); model = identify_board(ram[b], io[b]); release_region(ram[b], SRAM_PAGESIZE); } @@ -204,7 +205,7 @@ static int __init sc_init(void) * Nope, there was no place in RAM for the * board, or it couldn't be identified */ - pr_debug("Failed to find an adapter at 0x%x\n", ram[b]); + pr_debug("Failed to find an adapter at 0x%lx\n", ram[b]); continue; } @@ -270,14 +271,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; @@ -293,7 +293,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 @@ -301,7 +301,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)) { @@ -325,7 +324,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 @@ -335,14 +334,13 @@ 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, - SA_INTERRUPT, interface->id, NULL)) + IRQF_DISABLED, interface->id, NULL)) { kfree(sc_adapter[cinst]->channel); indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL); /* Fix me */ @@ -451,7 +449,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) HWConfig_pl hwci; int x; - pr_debug("Attempting to identify adapter @ 0x%x io 0x%x\n", + pr_debug("Attempting to identify adapter @ 0x%lx io 0x%x\n", rambase, iobase); /* @@ -490,7 +488,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) outb(PRI_BASEPG_VAL, pgport); msleep_interruptible(1000); sig = readl(rambase + SIG_OFFSET); - pr_debug("Looking for a signature, got 0x%x\n", sig); + pr_debug("Looking for a signature, got 0x%lx\n", sig); if(sig == SIGNATURE) return PRI_BOARD; @@ -500,7 +498,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) outb(BRI_BASEPG_VAL, pgport); msleep_interruptible(1000); sig = readl(rambase + SIG_OFFSET); - pr_debug("Looking for a signature, got 0x%x\n", sig); + pr_debug("Looking for a signature, got 0x%lx\n", sig); if(sig == SIGNATURE) return BRI_BOARD; @@ -510,7 +508,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) * Try to spot a card */ sig = readl(rambase + SIG_OFFSET); - pr_debug("Looking for a signature, got 0x%x\n", sig); + pr_debug("Looking for a signature, got 0x%lx\n", sig); if(sig != SIGNATURE) return -1; @@ -540,7 +538,7 @@ static int identify_board(unsigned long rambase, unsigned int iobase) memcpy_fromio(&rcvmsg, &(dpm->rsp_queue[dpm->rsp_tail]), MSG_LEN); pr_debug("Got HWConfig response, status = 0x%x\n", rcvmsg.rsp_status); memcpy(&hwci, &(rcvmsg.msg_data.HWCresponse), sizeof(HWConfig_pl)); - pr_debug("Hardware Config: Interface: %s, RAM Size: %d, Serial: %s\n" + pr_debug("Hardware Config: Interface: %s, RAM Size: %ld, Serial: %s\n" " Part: %s, Rev: %s\n", hwci.st_u_sense ? "S/T" : "U", hwci.ram_size, hwci.serial_no, hwci.part_no, hwci.rev_no);