X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fisdn%2Fhisax%2Fteles_cs.c;h=ab4bd455450eef1a7b6f5c39968b9416ac4bc459;hb=15d3b4a26291c170563e2b25ded5de1324f93959;hp=7b66038096f369e6a2c6a4d2aaf11d3da364be77;hpb=15b99ac1729503db9e6dc642a50b9b6cb3bf51f9;p=linux-2.6 diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 7b66038096..ab4bd45545 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -137,9 +136,8 @@ static int teles_probe(struct pcmcia_device *link) DEBUG(0, "teles_attach()\n"); /* 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) return -ENOMEM; - memset(local, 0, sizeof(local_info_t)); local->cardnr = -1; local->p_dev = link; @@ -164,7 +162,6 @@ static int teles_probe(struct pcmcia_device *link) link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; return teles_cs_config(link); } /* teles_attach */ @@ -179,17 +176,14 @@ static int teles_probe(struct pcmcia_device *link) static void teles_detach(struct pcmcia_device *link) { - local_info_t *info = link->priv; + local_info_t *info = link->priv; - DEBUG(0, "teles_detach(0x%p)\n", link); + DEBUG(0, "teles_detach(0x%p)\n", link); - if (link->state & DEV_CONFIG) { - info->busy = 1; - teles_cs_release(link); - } - - kfree(info); + info->busy = 1; + teles_cs_release(link); + kfree(info); } /* teles_detach */ /*====================================================================== @@ -236,26 +230,6 @@ static int teles_cs_config(struct pcmcia_device *link) DEBUG(0, "teles_config(0x%p)\n", link); dev = link->priv; - /* - This reads the card's CONFIG tuple to find its configuration - registers. - */ - tuple.DesiredTuple = CISTPL_CONFIG; - tuple.TupleData = (cisdata_t *)buf; - tuple.TupleDataMax = 255; - tuple.TupleOffset = 0; - tuple.Attributes = 0; - i = first_tuple(link, &tuple, &parse); - if (i != CS_SUCCESS) { - last_fn = ParseTuple; - goto cs_failed; - } - link->conf.ConfigBase = parse.config.base; - link->conf.Present = parse.config.rmask[0]; - - /* Configure card */ - link->state |= DEV_CONFIG; - tuple.TupleData = (cisdata_t *)buf; tuple.TupleOffset = 0; tuple.TupleDataMax = 255; tuple.Attributes = 0; @@ -319,8 +293,6 @@ static int teles_cs_config(struct pcmcia_device *link) link->io.BasePort2+link->io.NumPorts2-1); printk("\n"); - link->state &= ~DEV_CONFIG_PENDING; - icard.para[0] = link->irq.AssignedIRQ; icard.para[1] = link->io.BasePort1; icard.protocol = protocol;