/* This function configures the USB device stack based on USB descriptor and usb_cfg_data.  */
static int usb_device_init(void)
/* This function configures the USB device stack based on USB descriptor and usb_cfg_data.  */
static int usb_device_init(void)
{
	uint8_t *device_descriptor;
	if (usb_dev.enabled == true) {
		return -EALREADY;
	}
	device_descriptor = usb_get_device_descriptor();
	if (!device_descriptor) {
		LOG_ERR("Failed to configure USB device stack");
		return -1;
	}
	usb_set_config(device_descriptor);
	if (IS_ENABLED(CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT)) {
		return usb_enable(NULL);
	}
	return 0;
}