aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-06-27 07:45:09 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:48 -0400
commit40051e4686d6fa8743a38933727604f75bef05cf (patch)
tree6ee90f22be3f31e041f154402c7a220a2ceddf89 /net
parenta2b1976b8e0184635a1119f8511fc3e68902e429 (diff)
Bluetooth: Remove unneeded hci_conn_disconnect abstraction
The abstraction of disconnect operation via hci_conn_disconnect is not needed and it does not add any readability. Handle the difference of AMP physical channels and BR/EDR/LE connection in the timeout callback. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_conn.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index cc64fbe952fa..6d0fe3df2fa5 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -271,21 +271,6 @@ void hci_sco_setup(struct hci_conn *conn, __u8 status)
271 } 271 }
272} 272}
273 273
274static void hci_conn_disconnect(struct hci_conn *conn)
275{
276 __u8 reason;
277
278 switch (conn->type) {
279 case AMP_LINK:
280 hci_amp_disconn(conn);
281 break;
282 default:
283 reason = hci_proto_disconn_ind(conn);
284 hci_disconnect(conn, reason);
285 break;
286 }
287}
288
289static void hci_conn_timeout(struct work_struct *work) 274static void hci_conn_timeout(struct work_struct *work)
290{ 275{
291 struct hci_conn *conn = container_of(work, struct hci_conn, 276 struct hci_conn *conn = container_of(work, struct hci_conn,
@@ -320,7 +305,12 @@ static void hci_conn_timeout(struct work_struct *work)
320 break; 305 break;
321 case BT_CONFIG: 306 case BT_CONFIG:
322 case BT_CONNECTED: 307 case BT_CONNECTED:
323 hci_conn_disconnect(conn); 308 if (conn->type == AMP_LINK) {
309 hci_amp_disconn(conn);
310 } else {
311 __u8 reason = hci_proto_disconn_ind(conn);
312 hci_disconnect(conn, reason);
313 }
324 break; 314 break;
325 default: 315 default:
326 conn->state = BT_CLOSED; 316 conn->state = BT_CLOSED;