Bluetooth: Check for flag instead of features in update_adv_data()
authorJohan Hedberg <johan.hedberg@intel.com>
Sat, 19 Oct 2013 20:38:16 +0000 (23:38 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 20 Oct 2013 16:05:40 +0000 (09:05 -0700)
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>
net/bluetooth/mgmt.c

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