]> err.no Git - linux-2.6/blobdiff - drivers/bluetooth/btuart_cs.c
[PATCH] i2c-i801: Remove force_addr parameter
[linux-2.6] / drivers / bluetooth / btuart_cs.c
index 594839061360595734df52be2656e4edc18813d1..9ce4c93467e57da73794711497e80936baaeaf3d 100644 (file)
@@ -84,7 +84,7 @@ typedef struct btuart_info_t {
 } btuart_info_t;
 
 
-static void btuart_config(struct pcmcia_device *link);
+static int btuart_config(struct pcmcia_device *link);
 static void btuart_release(struct pcmcia_device *link);
 
 static void btuart_detach(struct pcmcia_device *p_dev);
@@ -152,7 +152,7 @@ static void btuart_write_wakeup(btuart_info_t *info)
 
                clear_bit(XMIT_WAKEUP, &(info->tx_state));
 
-               if (!(info->p_dev->state & DEV_PRESENT))
+               if (!pcmcia_dev_present(info->p_dev))
                        return;
 
                if (!(skb = skb_dequeue(&(info->txq))))
@@ -576,7 +576,7 @@ static int btuart_close(btuart_info_t *info)
        return 0;
 }
 
-static int btuart_attach(struct pcmcia_device *link)
+static int btuart_probe(struct pcmcia_device *link)
 {
        btuart_info_t *info;
 
@@ -599,10 +599,7 @@ static int btuart_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;
-       btuart_config(link);
-
-       return 0;
+       return btuart_config(link);
 }
 
 
@@ -610,9 +607,7 @@ static void btuart_detach(struct pcmcia_device *link)
 {
        btuart_info_t *info = link->priv;
 
-       if (link->state & DEV_CONFIG)
-               btuart_release(link);
-
+       btuart_release(link);
        kfree(info);
 }
 
@@ -641,7 +636,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *
        return get_tuple(handle, tuple, parse);
 }
 
-static void btuart_config(struct pcmcia_device *link)
+static int btuart_config(struct pcmcia_device *link)
 {
        static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
        btuart_info_t *info = link->priv;
@@ -666,9 +661,6 @@ static void btuart_config(struct pcmcia_device *link)
        link->conf.ConfigBase = parse.config.base;
        link->conf.Present = parse.config.rmask[0];
 
-       /* Configure card */
-       link->state |= DEV_CONFIG;
-
        /* First pass: look for a config entry that looks normal. */
        tuple.TupleData = (cisdata_t *) buf;
        tuple.TupleOffset = 0;
@@ -739,15 +731,15 @@ found_port:
 
        strcpy(info->node.dev_name, info->hdev->name);
        link->dev_node = &info->node;
-       link->state &= ~DEV_CONFIG_PENDING;
 
-       return;
+       return 0;
 
 cs_failed:
        cs_error(link, last_fn, last_ret);
 
 failed:
        btuart_release(link);
+       return -ENODEV;
 }
 
 
@@ -755,8 +747,7 @@ static void btuart_release(struct pcmcia_device *link)
 {
        btuart_info_t *info = link->priv;
 
-       if (link->state & DEV_PRESENT)
-               btuart_close(info);
+       btuart_close(info);
 
        pcmcia_disable_device(link);
 }
@@ -772,7 +763,7 @@ static struct pcmcia_driver btuart_driver = {
        .drv            = {
                .name   = "btuart_cs",
        },
-       .probe          = btuart_attach,
+       .probe          = btuart_probe,
        .remove         = btuart_detach,
        .id_table       = btuart_ids,
 };