请问各位同志,设备树中的节点名称是否会含有‘/’字符,如果不含这个字符,那么下列内核源码的第623行是在判断什么?为什么要判断?
609 int __init of_scan_flat_dt(int (*it)(unsigned long node,
610 const char *uname, int depth,
611 void *data),
612 void *data)
613 {
614 const void *blob = initial_boot_params;
615 const char *pathp;
616 int offset, rc = 0, depth = -1;
617
618 for (offset = fdt_next_node(blob, -1, &depth);
619 offset >= 0 && depth >= 0 && !rc;
620 offset = fdt_next_node(blob, offset, &depth)) {
621
622 pathp = fdt_get_name(blob, offset, NULL);
623 if (*pathp == '/')
624 pathp = kbasename(pathp);
625 rc = it(offset, pathp, depth, data); //early_init_dt_scan_chosen() // data = boot_command_line
626 }
627 return rc;
628 }

一个有关设备树的问题
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-