usb: Add error log to help debugging
Change-Id: Id320dc2b85f0a48a8f81425468aa3229b1e7d0cb Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
4ea0ab9ac0
commit
ecdcbe5077
1 changed files with 4 additions and 0 deletions
|
@ -948,21 +948,25 @@ int usb_dc_ep_read(const uint8_t ep, uint8_t *const data,
|
|||
uint32_t i, j, data_len, bytes_to_copy;
|
||||
|
||||
if (!usb_dw_ctrl.attached && !usb_dw_ep_is_valid(ep)) {
|
||||
SYS_LOG_ERR("No valid endpoint");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check if OUT ep */
|
||||
if (USB_DW_EP_ADDR2DIR(ep) != USB_EP_DIR_OUT) {
|
||||
SYS_LOG_ERR("Wrong endpoint direction");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Allow to read 0 bytes */
|
||||
if (!data && max_data_len) {
|
||||
SYS_LOG_ERR("Wrong arguments");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check if ep enabled */
|
||||
if (!usb_dw_ep_is_enabled(ep)) {
|
||||
SYS_LOG_ERR("Not enabled endpoint");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue