Linux bluetooth development
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v3 04/14] Bluetooth: Make mgmt_start_discovery_failed static
Date: Tue, 30 Apr 2013 15:29:30 -0300	[thread overview]
Message-ID: <1367346580-6647-5-git-send-email-andre.guedes@openbossa.org> (raw)
In-Reply-To: <1367346580-6647-1-git-send-email-andre.guedes@openbossa.org>

mgmt_start_discovery_failed is now only used in mgmt.c so we can
make it a local function. This patch also moves the mgmt_start_
discovery_failed definition up in mgmt.c to avoid forward
declaration.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 include/net/bluetooth/hci_core.h |  1 -
 net/bluetooth/mgmt.c             | 42 ++++++++++++++++++++--------------------
 2 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 1ff7f67..aa7eed7 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1169,7 +1169,6 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 		      u8 ssp, u8 *eir, u16 eir_len);
 int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 		     u8 addr_type, s8 rssi, u8 *name, u8 name_len);
-int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status);
 int mgmt_stop_discovery_failed(struct hci_dev *hdev, u8 status);
 int mgmt_discovering(struct hci_dev *hdev, u8 discovering);
 int mgmt_interleaved_discovery(struct hci_dev *hdev);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index c701eac..0572cb1 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2650,6 +2650,27 @@ int mgmt_interleaved_discovery(struct hci_dev *hdev)
 	return err;
 }
 
+static int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
+{
+	struct pending_cmd *cmd;
+	u8 type;
+	int err;
+
+	hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
+
+	cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
+	if (!cmd)
+		return -ENOENT;
+
+	type = hdev->discovery.type;
+
+	err = cmd_complete(cmd->sk, hdev->id, cmd->opcode, mgmt_status(status),
+			   &type, sizeof(type));
+	mgmt_pending_remove(cmd);
+
+	return err;
+}
+
 static void start_discovery_complete(struct hci_dev *hdev, u8 status)
 {
 	BT_DBG("status %d", status);
@@ -4169,27 +4190,6 @@ int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 			  sizeof(*ev) + eir_len, NULL);
 }
 
-int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status)
-{
-	struct pending_cmd *cmd;
-	u8 type;
-	int err;
-
-	hci_discovery_set_state(hdev, DISCOVERY_STOPPED);
-
-	cmd = mgmt_pending_find(MGMT_OP_START_DISCOVERY, hdev);
-	if (!cmd)
-		return -ENOENT;
-
-	type = hdev->discovery.type;
-
-	err = cmd_complete(cmd->sk, hdev->id, cmd->opcode, mgmt_status(status),
-			   &type, sizeof(type));
-	mgmt_pending_remove(cmd);
-
-	return err;
-}
-
 int mgmt_stop_discovery_failed(struct hci_dev *hdev, u8 status)
 {
 	struct pending_cmd *cmd;
-- 
1.8.2.1


  parent reply	other threads:[~2013-04-30 18:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 18:29 [PATCH v3 00/14] Update Discovery to use HCI request framework Andre Guedes
2013-04-30 18:29 ` [PATCH v3 01/14] Bluetooth: Make inquiry_cache_flush non-static Andre Guedes
2013-04-30 18:29 ` [PATCH v3 02/14] Bluetooth: Update start_discovery to use HCI request Andre Guedes
2013-04-30 18:29 ` [PATCH v3 03/14] Bluetooth: Remove start discovery handling from hci_event.c Andre Guedes
2013-04-30 18:29 ` Andre Guedes [this message]
2013-04-30 18:29 ` [PATCH v3 05/14] Bluetooth: Move discovery macros to hci_core.h Andre Guedes
2013-04-30 18:29 ` [PATCH v3 06/14] Bluetooth: Use HCI request in interleaved discovery Andre Guedes
2013-04-30 18:29 ` [PATCH v3 07/14] Bluetooth: Update stop_discovery to use HCI request Andre Guedes
2013-04-30 18:29 ` [PATCH v3 08/14] Bluetooth: Remove stop discovery handling from hci_event.c Andre Guedes
2013-04-30 18:29 ` [PATCH v3 09/14] Bluetooth: Make mgmt_stop_discovery_failed static Andre Guedes
2013-04-30 18:29 ` [PATCH v3 10/14] Bluetooth: Refactor hci_cc_le_set_scan_enable Andre Guedes
2013-04-30 18:29 ` [PATCH v3 11/14] Bluetooth: Remove LE scan helpers Andre Guedes
2013-04-30 18:29 ` [PATCH v3 12/14] Bluetooth: Remove inquiry helpers Andre Guedes
2013-04-30 18:29 ` [PATCH v3 13/14] Bluetooth: Remove empty event handler Andre Guedes
2013-04-30 18:29 ` [PATCH v3 14/14] Bluetooth: Mgmt Device Found Event Andre Guedes
2013-05-03 22:25   ` Gustavo Padovan
2013-05-02  1:59 ` [PATCH v3 00/14] Update Discovery to use HCI request framework Marcel Holtmann
2013-05-02 13:16   ` Andre Guedes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1367346580-6647-5-git-send-email-andre.guedes@openbossa.org \
    --to=andre.guedes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox