OSDN Git Service

android: Move load_link_keys_complete() to a more sensible location
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 23 Oct 2013 07:30:57 +0000 (10:30 +0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Wed, 23 Oct 2013 07:30:57 +0000 (10:30 +0300)
android/adapter.c

index 1a3e3f4..de3660d 100644 (file)
@@ -50,29 +50,6 @@ struct bt_adapter {
 
 static struct bt_adapter *default_adapter;
 
-static void load_link_keys_complete(uint8_t status, uint16_t length,
-                                       const void *param, void *user_data)
-{
-       struct bt_adapter *adapter = user_data;
-       int err;
-
-       if (status) {
-               error("Failed to load link keys for index %u: %s (0x%02x)",
-                       adapter->index, mgmt_errstr(status), status);
-               err = -EIO;
-               goto failed;
-       }
-
-       DBG("status %u", status);
-
-       default_adapter = adapter;
-       adapter->ready(adapter, 0);
-       return;
-
-failed:
-       adapter->ready(NULL, err);
-}
-
 static void mgmt_local_name_changed_event(uint16_t index, uint16_t length,
                                        const void *param, void *user_data)
 {
@@ -201,6 +178,29 @@ static void register_mgmt_handlers(struct bt_adapter *adapter)
                        adapter, NULL);
 }
 
+static void load_link_keys_complete(uint8_t status, uint16_t length,
+                                       const void *param, void *user_data)
+{
+       struct bt_adapter *adapter = user_data;
+       int err;
+
+       if (status) {
+               error("Failed to load link keys for index %u: %s (0x%02x)",
+                       adapter->index, mgmt_errstr(status), status);
+               err = -EIO;
+               goto failed;
+       }
+
+       DBG("status %u", status);
+
+       default_adapter = adapter;
+       adapter->ready(adapter, 0);
+       return;
+
+failed:
+       adapter->ready(NULL, err);
+}
+
 static void load_link_keys(struct bt_adapter *adapter, GSList *keys)
 {
        struct mgmt_cp_load_link_keys *cp;