Now that pending commands are hci_dev specific there's no need to check
whether a command matches hci_dev when iterating through them.
Signed-off-by: Johan Hedberg <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo F. Padovan <[email protected]>
if (opcode > 0 && cmd->opcode != opcode)
continue;
- if (hdev && cmd->index != hdev->id)
- continue;
-
cb(cmd, data);
}
}
struct pending_cmd *cmd;
list_for_each_entry(cmd, &hdev->mgmt_pending, list) {
- if (cmd->opcode != opcode)
- continue;
-
- if (hdev && cmd->index != hdev->id)
- continue;
-
- return cmd;
+ if (cmd->opcode == opcode)
+ return cmd;
}
return NULL;
if (cmd->opcode != MGMT_OP_PAIR_DEVICE)
continue;
- if (cmd->index != hdev->id)
- continue;
-
if (cmd->user_data != conn)
continue;