/* Allocate buffer and initiate a new control OUT transfer, use successive buffer descriptor when next is true.  */
static int usbfsotg_ctrl_feed_dout(const struct device *dev, const size_t length, const bool next, const bool resume_tx)
/* Allocate buffer and initiate a new control OUT transfer, use successive buffer descriptor when next is true.  */
static int usbfsotg_ctrl_feed_dout(const struct device *dev, const size_t length, const bool next, const bool resume_tx)
{
	struct net_buf *buf;
	int ret;
	buf = udc_ctrl_alloc(dev, USB_CONTROL_EP_OUT, length);
	if (buf == NULL) {
		return -ENOMEM;
	}
	if (next) {
		ret = usbfsotg_ctrl_feed_start_next(dev, buf);
	} else {
		ret = usbfsotg_ctrl_feed_start(dev, buf);
	}
	if (ret) {
		net_buf_unref(buf);
		return ret;
	}
	if (resume_tx) {
		usbfsotg_resume_tx(dev);
	}
	return 0;
}