Bluetooth: L2CAP: Remove use of k_sem for credits

With the changes that introduced a queue k_sem is only used with
K_NO_WAIT which means it is no longer possible to wait/block for credits
so the usage of k_sem is no longer needed and can be safely replaced
with atomic_t just to count the available credits at a given instant.

Fixes #19922

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2019-12-18 13:27:36 -08:00 committed by Johan Hedberg
commit 4ff711d8a5
2 changed files with 33 additions and 23 deletions

View file

@ -118,7 +118,7 @@ struct bt_l2cap_le_endpoint {
/** Endpoint initial credits */
u16_t init_credits;
/** Endpoint credits */
struct k_sem credits;
atomic_t credits;
};
/** @brief LE L2CAP Channel structure. */