Bluetooth: Enable per-module dynamic debug messages
[pandora-kernel.git] / drivers / bluetooth / btsdio.c
index b786f61..7e29827 100644 (file)
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 
-#ifndef CONFIG_BT_HCIBTSDIO_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
 #define VERSION "0.1"
 
 static const struct sdio_device_id btsdio_table[] = {
@@ -91,6 +86,7 @@ static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)
 
        err = sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
        if (err < 0) {
+               skb_pull(skb, 4);
                sdio_writeb(data->func, 0x01, REG_PC_WRT, NULL);
                return err;
        }
@@ -152,7 +148,7 @@ static int btsdio_rx_packet(struct btsdio_data *data)
 
        err = sdio_readsb(data->func, skb->data, REG_RDAT, len - 4);
        if (err < 0) {
-               kfree(skb);
+               kfree_skb(skb);
                return err;
        }
 
@@ -162,10 +158,8 @@ static int btsdio_rx_packet(struct btsdio_data *data)
        bt_cb(skb)->pkt_type = hdr[3];
 
        err = hci_recv_frame(skb);
-       if (err < 0) {
-               kfree(skb);
+       if (err < 0)
                return err;
-       }
 
        sdio_writeb(data->func, 0x00, REG_PC_RRT, NULL);