OSDN Git Service

bt: Fix HCI driver selection logic for Qualcomm Bluetooth
authorEthan Chen <intervigil@gmail.com>
Mon, 3 Oct 2016 22:39:10 +0000 (15:39 -0700)
committerEthan Chen <intervigil@gmail.com>
Tue, 4 Oct 2016 02:32:03 +0000 (19:32 -0700)
* Previously BT_SOC_SMD was the same as BT_SOC_DEFAULT, which
  is no longer true.
* The iteration to determine SOC type only worked due to the specific
  values of BT_SOC_DEFAULT and BT_SOC_SMD previously. Fix the iteration
  to actually check all SOC types.

Change-Id: If282200737099d6587f3dc6fcd0a7e70b93996cb

utils/src/bt_utils.c

index 6f0f205..59dece9 100644 (file)
@@ -1101,9 +1101,9 @@ static void init_soc_type()
     soc_type = BT_SOC_DEFAULT;
     ret = property_get("qcom.bluetooth.soc", bt_soc_type, NULL);
     if (ret != 0) {
-        int i;
+        unsigned int i;
         ALOGI("qcom.bluetooth.soc set to %s\n", bt_soc_type);
-        for ( i = BT_SOC_AR3K ; i < BT_SOC_RESERVED ; i++ )
+        for ( i = 0 ; i < sizeof(soc_type_entries)/sizeof(soc_type_entries[0]) ; i++ )
         {
             char* soc_name = soc_type_entries[i].soc_name;
             if (!strcmp(bt_soc_type, soc_name)) {