u-boot driver_check_compatible函数

/**
 * driver_check_compatible() - Check if a driver matches a compatible string
 *
 * @param of_match:    List of compatible strings to match
 * @param of_idp:    Returns the match that was found
 * @param compat:    The compatible string to search for
 * @return 0 if there is a match, -ENOENT if no match
 */
static int driver_check_compatible(const struct udevice_id *of_match,
                   const struct udevice_id **of_idp,
                   const char *compat)
{
    if (!of_match)
        return -ENOENT;

    while (of_match->compatible) {
        if (!strcmp(of_match->compatible, compat)) {
            *of_idp = of_match;
            return 0;
        }
        of_match++;
    }

    return -ENOENT;
}

函数位于driver/core/list.c文件。

 

上一篇:某验五子棋验证码


下一篇:Exchange 2013和2019共存部署实验系列(三)Exchange2013客户端访问服务安装