]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/isdn/hisax/teles_cs.c
Pull trivial into release branch
[mv-sheeva.git] / drivers / isdn / hisax / teles_cs.c
index 698e9ec95f0be07dbef1cb07b53b7ddc0f3d3aec..afcc2aeadb3440b922e3f4eba3a62af2f200821c 100644 (file)
@@ -75,7 +75,7 @@ module_param(protocol, int, 0);
    handler.
 */
 
-static void teles_cs_config(struct pcmcia_device *link);
+static int teles_cs_config(struct pcmcia_device *link);
 static void teles_cs_release(struct pcmcia_device *link);
 
 /*
@@ -130,7 +130,7 @@ typedef struct local_info_t {
 
 ======================================================================*/
 
-static int teles_attach(struct pcmcia_device *link)
+static int teles_probe(struct pcmcia_device *link)
 {
     local_info_t *local;
 
@@ -164,10 +164,7 @@ static int teles_attach(struct pcmcia_device *link)
     link->conf.Attributes = CONF_ENABLE_IRQ;
     link->conf.IntType = INT_MEMORY_AND_IO;
 
-    link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
-    teles_cs_config(link);
-
-    return 0;
+    return teles_cs_config(link);
 } /* teles_attach */
 
 /*======================================================================
@@ -181,17 +178,14 @@ static int teles_attach(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 */
 
 /*======================================================================
@@ -225,7 +219,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple,
     return get_tuple(handle, tuple, parse);
 }
 
-static void teles_cs_config(struct pcmcia_device *link)
+static int teles_cs_config(struct pcmcia_device *link)
 {
     tuple_t tuple;
     cisparse_t parse;
@@ -255,9 +249,6 @@ static void teles_cs_config(struct pcmcia_device *link)
     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;
@@ -321,8 +312,6 @@ static void 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;
@@ -333,13 +322,16 @@ static void teles_cs_config(struct pcmcia_device *link)
        printk(KERN_ERR "teles_cs: failed to initialize Teles PCMCIA %d at i/o %#x\n",
                i, link->io.BasePort1);
        teles_cs_release(link);
-    } else
-       ((local_info_t*)link->priv)->cardnr = i;
+       return -ENODEV;
+    }
+
+    ((local_info_t*)link->priv)->cardnr = i;
+    return 0;
 
-    return;
 cs_failed:
     cs_error(link, last_fn, i);
     teles_cs_release(link);
+    return -ENODEV;
 } /* teles_cs_config */
 
 /*======================================================================
@@ -396,7 +388,7 @@ static struct pcmcia_driver teles_cs_driver = {
        .drv            = {
                .name   = "teles_cs",
        },
-       .probe          = teles_attach,
+       .probe          = teles_probe,
        .remove         = teles_detach,
        .id_table       = teles_ids,
        .suspend        = teles_suspend,