Skip to content
Browse files

usb: usb_dc_stm32: Return EAGAIN on lock failure

Return -EAGAIN on k_sem_take() failure to take write lock, the error
code is similar to nrfx write_in_progress flag.

Signed-off-by: Andrei Emeltchenko <>
  • Loading branch information...
finikorg authored and carlescufi committed Apr 24, 2019
1 parent be1ec78 commit 5a4a658de175c8982c49a1c696e1b58c6fe5fb4f
Showing with 2 additions and 2 deletions.
  1. +2 −2 drivers/usb/device/usb_dc_stm32.c
@@ -737,8 +737,8 @@ int usb_dc_ep_write(const u8_t ep, const u8_t *const data,

ret = k_sem_take(&ep_state->write_sem, K_NO_WAIT);
if (ret) {
LOG_ERR("Unable to write ep 0x%02x (%d)", ep, ret);
return ret;
LOG_ERR("Unable to get write lock (%d)", ret);
return -EAGAIN;

if (!k_is_in_isr()) {

0 comments on commit 5a4a658

Please sign in to comment.
You can’t perform that action at this time.