Bluetooth: Fix error returns for Read Local OOB Extended Data commands
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / hci_request.c
index 42fa10522e899bc059ce33c1e7923bab25731b58..55e096d20a0fc61ea2bb8f1ee895e36788a47559 100644 (file)
@@ -307,7 +307,7 @@ static void set_random_addr(struct hci_request *req, bdaddr_t *rpa)
        if (hci_dev_test_flag(hdev, HCI_LE_ADV) ||
            hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT)) {
                BT_DBG("Deferring random address update");
-               set_bit(HCI_RPA_EXPIRED, &hdev->dev_flags);
+               hci_dev_set_flag(hdev, HCI_RPA_EXPIRED);
                return;
        }
 
@@ -329,7 +329,7 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
 
                *own_addr_type = ADDR_LE_DEV_RANDOM;
 
-               if (!test_and_clear_bit(HCI_RPA_EXPIRED, &hdev->dev_flags) &&
+               if (!hci_dev_test_and_clear_flag(hdev, HCI_RPA_EXPIRED) &&
                    !bacmp(&hdev->random_addr, &hdev->rpa))
                        return 0;
 
@@ -383,7 +383,7 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
         * and a static address has been configured, then use that
         * address instead of the public BR/EDR address.
         */
-       if (test_bit(HCI_FORCE_STATIC_ADDR, &hdev->dbg_flags) ||
+       if (hci_dev_test_flag(hdev, HCI_FORCE_STATIC_ADDR) ||
            !bacmp(&hdev->bdaddr, BDADDR_ANY) ||
            (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED) &&
             bacmp(&hdev->static_addr, BDADDR_ANY))) {