aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-08-18 13:33:33 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-09-08 13:07:55 -0400
commite3f2f92a047cd2be3c87a2aaf0a8958e1fd4c17a (patch)
tree843217afaf839520687b9ce8de302e53a563799d /net/bluetooth
parente3b679d56caa2bc555dee646a6ac5861631e7a28 (diff)
Bluetooth: Use hci_disconnect() for mgmt_disconnect_device()
There's no reason to custom build the HCI_Disconnect command in the Disconnect Device mgmt command handler. This patch updates the code to use hci_disconnect() instead. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index d8c66663ade8..ab9521ae3c63 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2788,7 +2788,6 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data,
2788{ 2788{
2789 struct mgmt_cp_disconnect *cp = data; 2789 struct mgmt_cp_disconnect *cp = data;
2790 struct mgmt_rp_disconnect rp; 2790 struct mgmt_rp_disconnect rp;
2791 struct hci_cp_disconnect dc;
2792 struct pending_cmd *cmd; 2791 struct pending_cmd *cmd;
2793 struct hci_conn *conn; 2792 struct hci_conn *conn;
2794 int err; 2793 int err;
@@ -2836,10 +2835,7 @@ static int disconnect(struct sock *sk, struct hci_dev *hdev, void *data,
2836 goto failed; 2835 goto failed;
2837 } 2836 }
2838 2837
2839 dc.handle = cpu_to_le16(conn->handle); 2838 err = hci_disconnect(conn, HCI_ERROR_REMOTE_USER_TERM);
2840 dc.reason = HCI_ERROR_REMOTE_USER_TERM;
2841
2842 err = hci_send_cmd(hdev, HCI_OP_DISCONNECT, sizeof(dc), &dc);
2843 if (err < 0) 2839 if (err < 0)
2844 mgmt_pending_remove(cmd); 2840 mgmt_pending_remove(cmd);
2845 2841