/* This function finds a usb class driver by specified class code and subclass code. */
ucd_t rt_usb_class_driver_find(int class_code, int subclass_code)
/* This function finds a usb class driver by specified class code and subclass code. */
ucd_t rt_usb_class_driver_find(int class_code, int subclass_code)
{
    struct rt_list_node *node;
    if (rt_thread_self() != RT_NULL)
        rt_enter_critical();
    for (node = _driver_list.next; node != &_driver_list; node = node->next)
    {
        ucd_t drv = 
            (ucd_t)rt_list_entry(node, struct uclass_driver, list);
        if (drv->class_code == class_code)
        {
            if (rt_thread_self() != RT_NULL)
                rt_exit_critical();
            return drv;
        }
    }
    if (rt_thread_self() != RT_NULL)
        rt_exit_critical();
    return RT_NULL;
}