diff options
Diffstat (limited to 'drivers/isdn/hardware')
-rw-r--r-- | drivers/isdn/hardware/avm/avm_cs.c | 39 | ||||
-rw-r--r-- | drivers/isdn/hardware/avm/avmcard.h | 4 | ||||
-rw-r--r-- | drivers/isdn/hardware/avm/b1.c | 12 | ||||
-rw-r--r-- | drivers/isdn/hardware/avm/b1dma.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hardware/avm/c4.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hardware/avm/t1isa.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/Kconfig | 2 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/debug.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/di.c | 8 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/diva.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/divasmain.c | 5 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/dsp_defs.h | 3 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/io.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/istream.c | 4 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/os_4bri.c | 2 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/platform.h | 8 |
16 files changed, 28 insertions, 76 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c index 7bbfd85ab79..eba10466ccc 100644 --- a/drivers/isdn/hardware/avm/avm_cs.c +++ b/drivers/isdn/hardware/avm/avm_cs.c @@ -121,10 +121,9 @@ static int avmcs_probe(struct pcmcia_device *p_dev) p_dev->conf.Present = PRESENT_OPTION; /* Allocate space for private device-specific data */ - local = kmalloc(sizeof(local_info_t), GFP_KERNEL); + local = kzalloc(sizeof(local_info_t), GFP_KERNEL); if (!local) goto err; - memset(local, 0, sizeof(local_info_t)); p_dev->priv = local; return avmcs_config(p_dev); @@ -194,41 +193,11 @@ static int avmcs_config(struct pcmcia_device *link) dev = link->priv; - /* - This reads the card's CONFIG tuple to find its configuration - registers. - */ do { - tuple.DesiredTuple = CISTPL_CONFIG; - i = pcmcia_get_first_tuple(link, &tuple); - if (i != CS_SUCCESS) break; - tuple.TupleData = buf; - tuple.TupleDataMax = 64; - tuple.TupleOffset = 0; - i = pcmcia_get_tuple_data(link, &tuple); - if (i != CS_SUCCESS) break; - i = pcmcia_parse_tuple(link, &tuple, &parse); - if (i != CS_SUCCESS) break; - link->conf.ConfigBase = parse.config.base; - } while (0); - if (i != CS_SUCCESS) { - cs_error(link, ParseTuple, i); - return -ENODEV; - } - - do { - - tuple.Attributes = 0; - tuple.TupleData = buf; - tuple.TupleDataMax = 254; - tuple.TupleOffset = 0; - tuple.DesiredTuple = CISTPL_VERS_1; - devname[0] = 0; - if( !first_tuple(link, &tuple, &parse) && parse.version_1.ns > 1 ) { - strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], - sizeof(devname)); - } + if (link->prod_id[1]) + strlcpy(devname, link->prod_id[1], sizeof(devname)); + /* * find IO port */ diff --git a/drivers/isdn/hardware/avm/avmcard.h b/drivers/isdn/hardware/avm/avmcard.h index 3b431723c7c..d964f07e4a5 100644 --- a/drivers/isdn/hardware/avm/avmcard.h +++ b/drivers/isdn/hardware/avm/avmcard.h @@ -554,7 +554,7 @@ void b1_register_appl(struct capi_ctr *ctrl, u16 appl, void b1_release_appl(struct capi_ctr *ctrl, u16 appl); u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); void b1_parse_version(avmctrl_info *card); -irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs); +irqreturn_t b1_interrupt(int interrupt, void *devptr); int b1ctl_read_proc(char *page, char **start, off_t off, int count, int *eof, struct capi_ctr *ctrl); @@ -567,7 +567,7 @@ void avmcard_dma_free(avmcard_dmainfo *); int b1pciv4_detect(avmcard *card); int t1pci_detect(avmcard *card); void b1dma_reset(avmcard *card); -irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs); +irqreturn_t b1dma_interrupt(int interrupt, void *devptr); int b1dma_load_firmware(struct capi_ctr *ctrl, capiloaddata *data); void b1dma_reset_ctr(struct capi_ctr *ctrl); diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c index 0c7061d5502..7a69a18d07e 100644 --- a/drivers/isdn/hardware/avm/b1.c +++ b/drivers/isdn/hardware/avm/b1.c @@ -65,18 +65,15 @@ avmcard *b1_alloc_card(int nr_controllers) avmctrl_info *cinfo; int i; - card = kmalloc(sizeof(*card), GFP_KERNEL); + card = kzalloc(sizeof(*card), GFP_KERNEL); if (!card) return NULL; - memset(card, 0, sizeof(*card)); - - cinfo = kmalloc(sizeof(*cinfo) * nr_controllers, GFP_KERNEL); + cinfo = kzalloc(sizeof(*cinfo) * nr_controllers, GFP_KERNEL); if (!cinfo) { kfree(card); return NULL; } - memset(cinfo, 0, sizeof(*cinfo) * nr_controllers); card->ctrlinfo = cinfo; for (i = 0; i < nr_controllers; i++) { @@ -485,7 +482,7 @@ void b1_parse_version(avmctrl_info *cinfo) /* ------------------------------------------------------------- */ -irqreturn_t b1_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +irqreturn_t b1_interrupt(int interrupt, void *devptr) { avmcard *card = devptr; avmctrl_info *cinfo = &card->ctrlinfo[0]; @@ -718,12 +715,11 @@ avmcard_dma_alloc(char *name, struct pci_dev *pdev, long rsize, long ssize) avmcard_dmainfo *p; void *buf; - p = kmalloc(sizeof(avmcard_dmainfo), GFP_KERNEL); + p = kzalloc(sizeof(avmcard_dmainfo), GFP_KERNEL); if (!p) { printk(KERN_WARNING "%s: no memory.\n", name); goto err; } - memset(p, 0, sizeof(avmcard_dmainfo)); p->recvbuf.size = rsize; buf = pci_alloc_consistent(pdev, rsize, &p->recvbuf.dmaaddr); diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index a4beeb46c85..ddd47cdfdb1 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c @@ -628,7 +628,7 @@ static void b1dma_handle_interrupt(avmcard *card) spin_unlock(&card->lock); } -irqreturn_t b1dma_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +irqreturn_t b1dma_interrupt(int interrupt, void *devptr) { avmcard *card = devptr; diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index 6c3d5f5f1f4..2a3eb38f0eb 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -713,7 +713,7 @@ static irqreturn_t c4_handle_interrupt(avmcard *card) return IRQ_HANDLED; } -static irqreturn_t c4_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +static irqreturn_t c4_interrupt(int interrupt, void *devptr) { avmcard *card = devptr; diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c index 5a2f854d55b..c925020fe9b 100644 --- a/drivers/isdn/hardware/avm/t1isa.c +++ b/drivers/isdn/hardware/avm/t1isa.c @@ -131,7 +131,7 @@ static int t1_detectandinit(unsigned int base, unsigned irq, int cardnr) return 0; } -static irqreturn_t t1isa_interrupt(int interrupt, void *devptr, struct pt_regs *regs) +static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) { avmcard *card = devptr; avmctrl_info *cinfo = &card->ctrlinfo[0]; @@ -584,6 +584,7 @@ static void __exit t1isa_exit(void) { int i; + unregister_capi_driver(&capi_driver_t1isa); for (i = 0; i < MAX_CARDS; i++) { if (!io[i]) break; diff --git a/drivers/isdn/hardware/eicon/Kconfig b/drivers/isdn/hardware/eicon/Kconfig index 51e66bc6420..01d4afd9d84 100644 --- a/drivers/isdn/hardware/eicon/Kconfig +++ b/drivers/isdn/hardware/eicon/Kconfig @@ -47,7 +47,7 @@ config ISDN_DIVAS_MAINT tristate "DIVA Maint driver support" depends on ISDN_DIVAS && m help - Enable Divas Maintainance driver. + Enable Divas Maintenance driver. endmenu diff --git a/drivers/isdn/hardware/eicon/debug.c b/drivers/isdn/hardware/eicon/debug.c index 6851c6270ce..d835e74ecf1 100644 --- a/drivers/isdn/hardware/eicon/debug.c +++ b/drivers/isdn/hardware/eicon/debug.c @@ -756,14 +756,14 @@ int diva_get_driver_info (dword id, byte* data, int data_length) { data_length -= 9; - if ((to_copy = MIN(strlen(clients[id].drvName), data_length-1))) { + if ((to_copy = min(strlen(clients[id].drvName), (size_t)(data_length-1)))) { memcpy (p, clients[id].drvName, to_copy); p += to_copy; data_length -= to_copy; if ((data_length >= 4) && clients[id].hDbg->drvTag[0]) { *p++ = '('; data_length -= 1; - if ((to_copy = MIN(strlen(clients[id].hDbg->drvTag), data_length-2))) { + if ((to_copy = min(strlen(clients[id].hDbg->drvTag), (size_t)(data_length-2)))) { memcpy (p, clients[id].hDbg->drvTag, to_copy); p += to_copy; data_length -= to_copy; diff --git a/drivers/isdn/hardware/eicon/di.c b/drivers/isdn/hardware/eicon/di.c index 0617d7cabf0..e1df8d98c31 100644 --- a/drivers/isdn/hardware/eicon/di.c +++ b/drivers/isdn/hardware/eicon/di.c @@ -133,7 +133,7 @@ void pr_out(ADAPTER * a) i = this->XCurrent; X = PTR_X(a,this); while(i<this->XNum && length<270) { - clength = MIN((word)(270-length),X[i].PLength-this->XOffset); + clength = min((word)(270-length),(word)(X[i].PLength-this->XOffset)); a->ram_out_buffer(a, &ReqOut->XBuffer.P[length], PTR_P(a,this,&X[i].P[this->XOffset]), @@ -622,7 +622,7 @@ byte isdn_ind(ADAPTER * a, sizeof(a->stream_buffer), &final, NULL, NULL); } - IoAdapter->RBuffer.length = MIN(MLength, 270); + IoAdapter->RBuffer.length = min(MLength, (word)270); if (IoAdapter->RBuffer.length != MLength) { this->complete = 0; } else { @@ -676,9 +676,9 @@ byte isdn_ind(ADAPTER * a, this->RCurrent++; } if (cma) { - clength = MIN(MLength, R[this->RCurrent].PLength-this->ROffset); + clength = min(MLength, (word)(R[this->RCurrent].PLength-this->ROffset)); } else { - clength = MIN(a->ram_inw(a, &RBuffer->length)-offset, + clength = min(a->ram_inw(a, &RBuffer->length)-offset, R[this->RCurrent].PLength-this->ROffset); } if(R[this->RCurrent].P) { diff --git a/drivers/isdn/hardware/eicon/diva.c b/drivers/isdn/hardware/eicon/diva.c index 8ab8027f33c..ffa2afa77c2 100644 --- a/drivers/isdn/hardware/eicon/diva.c +++ b/drivers/isdn/hardware/eicon/diva.c @@ -71,8 +71,6 @@ DivaIdiReqFunc(29) DivaIdiReqFunc(30) DivaIdiReqFunc(31) -struct pt_regs; - /* ** LOCALS */ @@ -515,7 +513,7 @@ diva_xdi_read(void *adapter, void *os_handle, void __user *dst, } -irqreturn_t diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs) +irqreturn_t diva_os_irq_wrapper(int irq, void *context) { diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) context; diva_xdi_clear_interrupts_proc_t clear_int_proc; diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c index b7dadba13e8..91fc92c01af 100644 --- a/drivers/isdn/hardware/eicon/divasmain.c +++ b/drivers/isdn/hardware/eicon/divasmain.c @@ -58,8 +58,7 @@ static char *DRIVERLNAME = "divas"; static char *DEVNAME = "Divas"; char *DRIVERRELEASE_DIVAS = "2.0"; -extern irqreturn_t diva_os_irq_wrapper(int irq, void *context, - struct pt_regs *regs); +extern irqreturn_t diva_os_irq_wrapper(int irq, void *context); extern int create_divas_proc(void); extern void remove_divas_proc(void); extern void diva_get_vserial_number(PISDN_ADAPTER IoAdapter, char *buf); @@ -186,7 +185,7 @@ void diva_log_info(unsigned char *format, ...) unsigned char line[160]; va_start(args, format); - vsprintf(line, format, args); + vsnprintf(line, sizeof(line), format, args); va_end(args); printk(KERN_INFO "%s: %s\n", DRIVERLNAME, line); diff --git a/drivers/isdn/hardware/eicon/dsp_defs.h b/drivers/isdn/hardware/eicon/dsp_defs.h index b44950e06f3..fec1e381a68 100644 --- a/drivers/isdn/hardware/eicon/dsp_defs.h +++ b/drivers/isdn/hardware/eicon/dsp_defs.h @@ -34,9 +34,6 @@ * * I/O functions returns -1 on error, 0 on EOF */ -#define OS_SEEK_SET 0 -#define OS_SEEK_CUR 1 -#define OS_SEEK_END 2 struct _OsFileHandle_; typedef long ( * OsFileIo) (struct _OsFileHandle_ *handle, void *buffer, diff --git a/drivers/isdn/hardware/eicon/io.c b/drivers/isdn/hardware/eicon/io.c index 4a27e230b0a..6fd9b007417 100644 --- a/drivers/isdn/hardware/eicon/io.c +++ b/drivers/isdn/hardware/eicon/io.c @@ -262,7 +262,7 @@ void request(PISDN_ADAPTER IoAdapter, ENTITY * e) case IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS: { diva_xdi_get_capi_parameters_t prms, *pI = &syncReq->xdi_capi_prms.info; memset (&prms, 0x00, sizeof(prms)); - prms.structure_length = MIN(sizeof(prms), pI->structure_length); + prms.structure_length = min_t(size_t, sizeof(prms), pI->structure_length); memset (pI, 0x00, pI->structure_length); prms.flag_dynamic_l1_down = (IoAdapter->capi_cfg.cfg_1 & \ DIVA_XDI_CAPI_CFG_1_DYNAMIC_L1_ON) ? 1 : 0; diff --git a/drivers/isdn/hardware/eicon/istream.c b/drivers/isdn/hardware/eicon/istream.c index 23139668d9b..18f8798442f 100644 --- a/drivers/isdn/hardware/eicon/istream.c +++ b/drivers/isdn/hardware/eicon/istream.c @@ -92,7 +92,7 @@ int diva_istream_write (void* context, return (-1); /* was not able to write */ break; /* only part of message was written */ } - to_write = MIN(length, DIVA_DFIFO_DATA_SZ); + to_write = min(length, DIVA_DFIFO_DATA_SZ); if (to_write) { a->ram_out_buffer (a, #ifdef PLATFORM_GT_32BIT @@ -176,7 +176,7 @@ int diva_istream_read (void* context, return (-1); /* was not able to read */ break; } - to_read = MIN(max_length, tmp[1]); + to_read = min(max_length, (int)tmp[1]); if (to_read) { a->ram_in_buffer(a, #ifdef PLATFORM_GT_32BIT diff --git a/drivers/isdn/hardware/eicon/os_4bri.c b/drivers/isdn/hardware/eicon/os_4bri.c index 11e6f937c1e..7b4ec3f60db 100644 --- a/drivers/isdn/hardware/eicon/os_4bri.c +++ b/drivers/isdn/hardware/eicon/os_4bri.c @@ -464,7 +464,7 @@ int diva_4bri_init_card(diva_os_xdi_adapter_t * a) /* ** Cleanup function will be called for master adapter only -** this is garanteed by design: cleanup callback is set +** this is guaranteed by design: cleanup callback is set ** by master adapter only */ static int diva_4bri_cleanup_adapter(diva_os_xdi_adapter_t * a) diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h index a66836cf756..2444811e0b3 100644 --- a/drivers/isdn/hardware/eicon/platform.h +++ b/drivers/isdn/hardware/eicon/platform.h @@ -83,14 +83,6 @@ #define NULL ((void *) 0) #endif -#ifndef MIN -#define MIN(a,b) ((a)>(b) ? (b) : (a)) -#endif - -#ifndef MAX -#define MAX(a,b) ((a)>(b) ? (a) : (b)) -#endif - #ifndef far #define far #endif |