瀏覽代碼

Bluetooth: Check for flag instead of features in update_adv_data()

It's better to check for the device flag instead of device features so
that we avoid unnecessary HCI commands when the feature is supported but
disabled (i.e. the flag is unset).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg 12 年之前
父節點
當前提交
10994ce6e6
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/bluetooth/mgmt.c

+ 1 - 1
net/bluetooth/mgmt.c

@@ -632,7 +632,7 @@ static void update_adv_data(struct hci_request *req)
 	struct hci_cp_le_set_adv_data cp;
 	struct hci_cp_le_set_adv_data cp;
 	u8 len;
 	u8 len;
 
 
-	if (!lmp_le_capable(hdev))
+	if (!test_bit(HCI_LE_ENABLED, &hdev->dev_flags))
 		return;
 		return;
 
 
 	memset(&cp, 0, sizeof(cp));
 	memset(&cp, 0, sizeof(cp));