Attention is currently required from: Jakub Czapiga, Martin L Roth, Maximilian Brune.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/81081?usp=email )
Change subject: lib/device_tree: Add some FDT helper functions ......................................................................
Patch Set 18:
(2 comments)
File src/include/device_tree.h:
https://review.coreboot.org/c/coreboot/+/81081/comment/920b5f7d_7326afa7 : PS18, Line 203:
To all functions?
Yes. I mean I'm not saying you need to do strict full doxygen style everywhere, but it should be possible to read the header and understand roughly what each function does and how to use it without digging through the code. In many cases that may be obvious already but for example for most of the return values here I don't think it is.
File src/lib/device_tree.c:
https://review.coreboot.org/c/coreboot/+/81081/comment/069740eb_9cf7f5c0 : PS18, Line 175: ""
I disagree. The root node is the same as any other node. Its name is an empty string. […]
Look at `dt_find_node()` which really does exactly the same thing, I think it works very cleanly. For the `/` case you will pass the path `{ NULL }` and then it just hits the `if (!*path)` base case of the recursion immediately.
In `fdt_find_node_by_path()`, if you use the `strtok_r()` solution as I suggested, it will automatically do the right thing for "/" (set `path_array[0]` to `NULL`), no special case needed.