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 <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2019-04-24 15:38:07 +03:00 committed by Carles Cufí
commit 5a4a658de1

View file

@ -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()) {