Skip to content

Commit

Permalink
usb: usb_dc_stm32: Return EAGAIN on lock failure
Browse files Browse the repository at this point in the history
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 <andrei.emeltchenko@intel.com>
  • Loading branch information
finikorg authored and carlescufi committed May 6, 2019
1 parent be1ec78 commit 5a4a658
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/device/usb_dc_stm32.c
Expand Up @@ -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()) {
Expand Down

0 comments on commit 5a4a658

Please sign in to comment.