X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fbluetooth%2Fhci_conn.c;h=f8880261da0e2d115a54526fe4a3625bf82fae08;hb=78c6146f16d45f52c33ddb6b48c10fc6cfc53659;hp=9483320f6dad01e967e219297ff798c5d1a29af0;hpb=b6a0dc822497e1c0b9e8c4add270cc27fce48454;p=linux-2.6 diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index 9483320f6d..f8880261da 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -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; }