[PATCH 2/2] adapter: Set default adapter id sooner

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When first adapter is registered set it as default before probing
drivers or profiles as those might depend on that e.g. hostname.

This fix hostname plugin setting default adapter name to 'foo #1'
instead of 'foo' if pretty hostname was received before probing
adapter drivers.
---
 src/adapter.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 9ddd2fc..276d897 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -5492,6 +5492,9 @@ static int adapter_register(struct btd_adapter *adapter)
 
 	btd_adapter_gatt_server_start(adapter);
 
+	if (default_adapter_id < 0)
+		default_adapter_id = adapter->dev_id;
+
 	load_config(adapter);
 	fix_storage(adapter);
 	load_drivers(adapter);
@@ -5506,9 +5509,6 @@ static int adapter_register(struct btd_adapter *adapter)
 
 	adapter->initialized = TRUE;
 
-	if (default_adapter_id < 0)
-		default_adapter_id = adapter->dev_id;
-
 	if (main_opts.did_source)
 		set_did(adapter, main_opts.did_vendor, main_opts.did_product,
 				main_opts.did_version, main_opts.did_source);
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux