Return-Path: From: Andre Guedes To: linux-bluetooth@vger.kernel.org Cc: Andre Guedes Subject: [PATCH 07/16] Bluetooth: Create cancel_inquiry() Date: Mon, 11 Jul 2011 18:11:50 -0300 Message-Id: <1310418719-12296-8-git-send-email-andre.guedes@openbossa.org> In-Reply-To: <1310418719-12296-1-git-send-email-andre.guedes@openbossa.org> References: <1310418719-12296-1-git-send-email-andre.guedes@openbossa.org> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: This patch moves all cancel inquiry code from stop_discovery() to a new function called cancel_inquiry(). Signed-off-by: Andre Guedes --- net/bluetooth/mgmt.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 7ea8f95..e43940e 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -1665,6 +1665,11 @@ failed: return err; } +static int cancel_inquiry(struct hci_dev *hdev) +{ + return hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL); +} + static int stop_discovery(struct sock *sk, u16 index) { struct hci_dev *hdev; @@ -1696,7 +1701,7 @@ static int stop_discovery(struct sock *sk, u16 index) goto failed; } - err = hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL); + err = cancel_inquiry(hdev); if (err < 0) mgmt_pending_remove(cmd); -- 1.7.4.1