/* Check if the endpoint of given address is valid.  */
static bool is_ep_valid(uint8_t ep)
/* Check if the endpoint of given address is valid.  */
static bool is_ep_valid(uint8_t ep)
{
	const struct usb_ep_cfg_data *ep_data;
	if (USB_EP_GET_IDX(ep) == 0) {
		return true;
	}
	STRUCT_SECTION_FOREACH(usb_cfg_data, cfg_data) {
		ep_data = cfg_data->endpoint;
		for (uint8_t n = 0; n < cfg_data->num_endpoints; n++) {
			if (ep_data[n].ep_addr == ep) {
				return true;
			}
		}
	}
	return false;
}