MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fdt_node_offset_by_phandle

Function fdt_node_offset_by_phandle

freebsd/contrib/libfdt/fdt_ro.c:595–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593}
594
595int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
596{
597 int offset;
598
599 if ((phandle == 0) || (phandle == -1))
600 return -FDT_ERR_BADPHANDLE;
601
602 FDT_CHECK_HEADER(fdt);
603
604 /* FIXME: The algorithm here is pretty horrible: we
605 * potentially scan each property of a node in
606 * fdt_get_phandle(), then if that didn't find what
607 * we want, we scan over them again making our way to the next
608 * node. Still it's the easiest to implement approach;
609 * performance can come later. */
610 for (offset = fdt_next_node(fdt, -1, NULL);
611 offset >= 0;
612 offset = fdt_next_node(fdt, offset, NULL)) {
613 if (fdt_get_phandle(fdt, offset) == phandle)
614 return offset;
615 }
616
617 return offset; /* error from fdt_next_node() */
618}
619
620int fdt_stringlist_contains(const char *strlist, int listlen, const char *str)
621{

Callers 2

overlay_get_targetFunction · 0.85
__get_phy_info_from_dtFunction · 0.85

Calls 2

fdt_next_nodeFunction · 0.85
fdt_get_phandleFunction · 0.85

Tested by

no test coverage detected