]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/parport/parport_cs.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6-omap-h63xx.git] / drivers / parport / parport_cs.c
index 6dcaf44c120aae639494570c473abb810b3cfe52..b953d5907c05aac311151b49cc1ecc5ff78ad1a4 100644 (file)
@@ -88,7 +88,7 @@ typedef struct parport_info_t {
 } parport_info_t;
 
 static void parport_detach(struct pcmcia_device *p_dev);
-static void parport_config(struct pcmcia_device *link);
+static int parport_config(struct pcmcia_device *link);
 static void parport_cs_release(struct pcmcia_device *);
 
 /*======================================================================
@@ -99,7 +99,7 @@ static void parport_cs_release(struct pcmcia_device *);
 
 ======================================================================*/
 
-static int parport_attach(struct pcmcia_device *link)
+static int parport_probe(struct pcmcia_device *link)
 {
     parport_info_t *info;
 
@@ -119,10 +119,7 @@ static int parport_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;
-    parport_config(link);
-
-    return 0;
+    return parport_config(link);
 } /* parport_attach */
 
 /*======================================================================
@@ -138,8 +135,7 @@ static void parport_detach(struct pcmcia_device *link)
 {
     DEBUG(0, "parport_detach(0x%p)\n", link);
 
-    if (link->state & DEV_CONFIG)
-       parport_cs_release(link);
+    parport_cs_release(link);
 
     kfree(link->priv);
 } /* parport_detach */
@@ -155,7 +151,7 @@ static void parport_detach(struct pcmcia_device *link)
 #define CS_CHECK(fn, ret) \
 do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
 
-void parport_config(struct pcmcia_device *link)
+static int parport_config(struct pcmcia_device *link)
 {
     parport_info_t *info = link->priv;
     tuple_t tuple;
@@ -177,9 +173,6 @@ void parport_config(struct pcmcia_device *link)
     CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
     link->conf.ConfigBase = parse.config.base;
     link->conf.Present = parse.config.rmask[0];
-    
-    /* Configure card */
-    link->state |= DEV_CONFIG;
 
     tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
     tuple.Attributes = 0;
@@ -235,15 +228,13 @@ void parport_config(struct pcmcia_device *link)
     strcpy(info->node.dev_name, p->name);
     link->dev_node = &info->node;
 
-    link->state &= ~DEV_CONFIG_PENDING;
-    return;
-    
+    return 0;
+
 cs_failed:
     cs_error(link, last_fn, last_ret);
 failed:
     parport_cs_release(link);
-    link->state &= ~DEV_CONFIG_PENDING;
-
+    return -ENODEV;
 } /* parport_config */
 
 /*======================================================================
@@ -282,7 +273,7 @@ static struct pcmcia_driver parport_cs_driver = {
        .drv            = {
                .name   = "parport_cs",
        },
-       .probe          = parport_attach,
+       .probe          = parport_probe,
        .remove         = parport_detach,
        .id_table       = parport_ids,
 };