]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/bluetooth/hci_h4.c
pcmcia: use pcmcia_loop_config in bluetooth drivers
[linux-2.6-omap-h63xx.git] / drivers / bluetooth / hci_h4.c
index 12e369a66fc24be1e2dba29cae82a679576ca32d..bfbae14cf93d0fe388fc879ff5ca5ed69b99a5f9 100644 (file)
  *
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/sched.h>
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/interrupt.h>
@@ -76,12 +74,10 @@ static int h4_open(struct hci_uart *hu)
 
        BT_DBG("hu %p", hu);
 
-       h4 = kmalloc(sizeof(*h4), GFP_ATOMIC);
+       h4 = kzalloc(sizeof(*h4), GFP_ATOMIC);
        if (!h4)
                return -ENOMEM;
 
-       memset(h4, 0, sizeof(*h4));
-
        skb_queue_head_init(&h4->txq);
 
        hu->priv = h4;
@@ -192,7 +188,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
                                continue;
 
                        case H4_W4_EVENT_HDR:
-                               eh = (struct hci_event_hdr *) h4->rx_skb->data;
+                               eh = hci_event_hdr(h4->rx_skb);
 
                                BT_DBG("Event header: evt 0x%2.2x plen %d", eh->evt, eh->plen);
 
@@ -200,7 +196,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
                                continue;
 
                        case H4_W4_ACL_HDR:
-                               ah = (struct hci_acl_hdr *) h4->rx_skb->data;
+                               ah = hci_acl_hdr(h4->rx_skb);
                                dlen = __le16_to_cpu(ah->dlen);
 
                                BT_DBG("ACL header: dlen %d", dlen);
@@ -209,7 +205,7 @@ static int h4_recv(struct hci_uart *hu, void *data, int count)
                                continue;
 
                        case H4_W4_SCO_HDR:
-                               sh = (struct hci_sco_hdr *) h4->rx_skb->data;
+                               sh = hci_sco_hdr(h4->rx_skb);
 
                                BT_DBG("SCO header: dlen %d", sh->dlen);