Skip to content
Permalink
Browse files

usb: device: Do not return error if ep already enabled

Fixes USB3CV Tool tests. One case is enabling endpoints with Set
Interface after Set Configuration. In this case we report warning and
continue without returning error.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information...
finikorg authored and carlescufi committed May 20, 2019
1 parent 1370f16 commit a95f6385f23f2028dca3f700bda1031b3565f6ca
Showing with 2 additions and 4 deletions.
  1. +2 −4 subsys/usb/usb_device.c
@@ -494,13 +494,11 @@ static bool set_endpoint(const struct usb_ep_descriptor *ep_desc)
ep_cfg.ep_addr, ep_cfg.ep_type, ep_cfg.ep_mps);

if (usb_dc_ep_configure(&ep_cfg) < 0) {
LOG_ERR("Failed to configure endpoint %x", ep_cfg.ep_addr);
return false;
LOG_WRN("Failed to configure endpoint %x", ep_cfg.ep_addr);
}

if (usb_dc_ep_enable(ep_cfg.ep_addr) < 0) {
LOG_ERR("Failed to enable endpoint %x", ep_cfg.ep_addr);
return false;
LOG_WRN("Failed to enable endpoint %x", ep_cfg.ep_addr);
}

usb_dev.configured = true;

0 comments on commit a95f638

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