/* All the functions below are part of public USB device support API.  */
int usbd_device_set_bcd(struct usbd_contex *const uds_ctx, const uint16_t bcd)
/* All the functions below are part of public USB device support API.  */
int usbd_device_set_bcd(struct usbd_contex *const uds_ctx, const uint16_t bcd)
{
	struct usb_device_descriptor *desc = uds_ctx->desc;
	int ret = 0;
	usbd_device_lock(uds_ctx);
	if (usbd_is_enabled(uds_ctx)) {
		ret = -EALREADY;
		goto set_bcd_exit;
	}
	desc->bcdUSB = sys_cpu_to_le16(bcd);
set_bcd_exit:
	usbd_device_unlock(uds_ctx);
	return ret;
}