提交 dc0f5088 编写于 作者: J Johan Hedberg 提交者: Marcel Holtmann

Bluetooth: Refactor l2cap_connect_cfm

This patch is a simple refactoring of l2cap_connect_cfm to allow easier
extension of the function.
Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 191eb398
...@@ -7268,13 +7268,16 @@ void l2cap_connect_cfm(struct hci_conn *hcon, u8 status) ...@@ -7268,13 +7268,16 @@ void l2cap_connect_cfm(struct hci_conn *hcon, u8 status)
BT_DBG("hcon %p bdaddr %pMR status %d", hcon, &hcon->dst, status); BT_DBG("hcon %p bdaddr %pMR status %d", hcon, &hcon->dst, status);
if (!status) { if (status) {
conn = l2cap_conn_add(hcon);
if (conn)
l2cap_conn_ready(conn);
} else {
l2cap_conn_del(hcon, bt_to_errno(status)); l2cap_conn_del(hcon, bt_to_errno(status));
return;
} }
conn = l2cap_conn_add(hcon);
if (!conn)
return;
l2cap_conn_ready(conn);
} }
int l2cap_disconn_ind(struct hci_conn *hcon) int l2cap_disconn_ind(struct hci_conn *hcon)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册