/* This function will create an usb function object. */
ufunction_t rt_usbd_function_new(udevice_t device, udev_desc_t dev_desc, ufunction_ops_t ops)
/* This function will create an usb function object. */
ufunction_t rt_usbd_function_new(udevice_t device, udev_desc_t dev_desc, ufunction_ops_t ops)
{
    ufunction_t func;
    LOG_D("rt_usbd_function_new");
    RT_ASSERT(device != RT_NULL);
    RT_ASSERT(dev_desc != RT_NULL);
    func = (ufunction_t)rt_malloc(sizeof(struct ufunction));
    if(func == RT_NULL)
    {
        rt_kprintf("alloc memory failed\n");
        return RT_NULL;
    }
    func->dev_desc = dev_desc;
    func->ops = ops;
    func->device = device;
    func->enabled = RT_FALSE;
    rt_list_init(&func->intf_list);
    return func;
}