]> err.no Git - linux-2.6/blobdiff - drivers/bluetooth/dtl1_cs.c
[PATCH] md: reformat code in raid1_end_write_request to avoid goto
[linux-2.6] / drivers / bluetooth / dtl1_cs.c
index 0ec7fd4c9214e36a05b5b7694ecf8f0e471ced5d..ed8dca84ff690a9a9918fdf1f19ef6788ab3a441 100644 (file)
@@ -159,7 +159,7 @@ static void dtl1_write_wakeup(dtl1_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))))
@@ -423,6 +423,9 @@ static int dtl1_hci_send_frame(struct sk_buff *skb)
        nsh.len = skb->len;
 
        s = bt_skb_alloc(NSHL + skb->len + 1, GFP_ATOMIC);
+       if (!s)
+               return -ENOMEM;
+
        skb_reserve(s, NSHL);
        memcpy(skb_put(s, skb->len), skb->data, skb->len);
        if (skb->len & 0x0001)
@@ -578,7 +581,6 @@ static int dtl1_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 dtl1_config(link);
 }
 
@@ -587,8 +589,7 @@ static void dtl1_detach(struct pcmcia_device *link)
 {
        dtl1_info_t *info = link->priv;
 
-       if (link->state & DEV_CONFIG)
-               dtl1_release(link);
+       dtl1_release(link);
 
        kfree(info);
 }
@@ -642,9 +643,6 @@ static int dtl1_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;
@@ -689,7 +687,6 @@ static int dtl1_config(struct pcmcia_device *link)
 
        strcpy(info->node.dev_name, info->hdev->name);
        link->dev_node = &info->node;
-       link->state &= ~DEV_CONFIG_PENDING;
 
        return 0;
 
@@ -706,8 +703,7 @@ static void dtl1_release(struct pcmcia_device *link)
 {
        dtl1_info_t *info = link->priv;
 
-       if (link->state & DEV_PRESENT)
-               dtl1_close(info);
+       dtl1_close(info);
 
        pcmcia_disable_device(link);
 }