]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/bluetooth/hci_conn.c
rfkill: handle SW_RFKILL_ALL events
[linux-2.6-omap-h63xx.git] / net / bluetooth / hci_conn.c
index 9483320f6dad01e967e219297ff798c5d1a29af0..f8880261da0e2d115a54526fe4a3625bf82fae08 100644 (file)
@@ -208,13 +208,8 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
 
        skb_queue_head_init(&conn->data_q);
 
-       init_timer(&conn->disc_timer);
-       conn->disc_timer.function = hci_conn_timeout;
-       conn->disc_timer.data = (unsigned long) conn;
-
-       init_timer(&conn->idle_timer);
-       conn->idle_timer.function = hci_conn_idle;
-       conn->idle_timer.data = (unsigned long) conn;
+       setup_timer(&conn->disc_timer, hci_conn_timeout, (unsigned long)conn);
+       setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn);
 
        atomic_set(&conn->refcnt, 0);
 
@@ -259,21 +254,12 @@ int hci_conn_del(struct hci_conn *conn)
        }
 
        tasklet_disable(&hdev->tx_task);
-
-       hci_conn_del_sysfs(conn);
-
        hci_conn_hash_del(hdev, conn);
        if (hdev->notify)
                hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
-
        tasklet_enable(&hdev->tx_task);
-
        skb_queue_purge(&conn->data_q);
-
-       hci_dev_put(hdev);
-
-       /* will free via device release */
-       put_device(&conn->dev);
+       hci_conn_del_sysfs(conn);
 
        return 0;
 }