aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/l2cap_core.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-04-06 14:28:37 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-04-11 15:34:15 -0400
commit76a68ba0ae097be72dfa8f918b3139130da769a4 (patch)
tree4a24ee83a895cfe49a23042989949e8b20d16deb /net/bluetooth/l2cap_core.c
parent9f8f962c85461324d18dcb2b1b94a932494d2cc5 (diff)
Bluetooth: rename hci_conn_put to hci_conn_drop
We use _get() and _put() for device ref-counting in the kernel. However, hci_conn_put() is _not_ used for ref-counting, hence, rename it to hci_conn_drop() so we can later fix ref-counting and introduce hci_conn_put(). hci_conn_hold() and hci_conn_put() are currently used to manage how long a connection should be held alive. When the last user drops the connection, we spawn a delayed work that performs the disconnect. Obviously, this has nothing to do with ref-counting for the _object_ but rather for the keep-alive of the connection. But we really _need_ proper ref-counting for the _object_ to allow connection-users like rfcomm-tty, HIDP or others. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/l2cap_core.c')
-rw-r--r--net/bluetooth/l2cap_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 7c7e9321f1ea..7cdb93c21b32 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -571,7 +571,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err)
571 chan->conn = NULL; 571 chan->conn = NULL;
572 572
573 if (chan->chan_type != L2CAP_CHAN_CONN_FIX_A2MP) 573 if (chan->chan_type != L2CAP_CHAN_CONN_FIX_A2MP)
574 hci_conn_put(conn->hcon); 574 hci_conn_drop(conn->hcon);
575 575
576 if (mgr && mgr->bredr_chan == chan) 576 if (mgr && mgr->bredr_chan == chan)
577 mgr->bredr_chan = NULL; 577 mgr->bredr_chan = NULL;
@@ -1697,7 +1697,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
1697 1697
1698 conn = l2cap_conn_add(hcon, 0); 1698 conn = l2cap_conn_add(hcon, 0);
1699 if (!conn) { 1699 if (!conn) {
1700 hci_conn_put(hcon); 1700 hci_conn_drop(hcon);
1701 err = -ENOMEM; 1701 err = -ENOMEM;
1702 goto done; 1702 goto done;
1703 } 1703 }
@@ -1707,7 +1707,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
1707 1707
1708 if (!list_empty(&conn->chan_l)) { 1708 if (!list_empty(&conn->chan_l)) {
1709 err = -EBUSY; 1709 err = -EBUSY;
1710 hci_conn_put(hcon); 1710 hci_conn_drop(hcon);
1711 } 1711 }
1712 1712
1713 if (err) 1713 if (err)