MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_ofw_find_node_by_phandle

Function rt_ofw_find_node_by_phandle

components/drivers/ofw/base.c:658–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658struct rt_ofw_node *rt_ofw_find_node_by_phandle(rt_phandle phandle)
659{
660 struct rt_ofw_node *np = RT_NULL;
661
662 if (phandle >= OFW_PHANDLE_MIN && phandle <= OFW_PHANDLE_MAX)
663 {
664 /* rebase from zero */
665 rt_phandle poff = phandle - _phandle_range[0];
666
667 np = _phandle_hash[poff];
668
669 if (!np)
670 {
671 rt_ofw_foreach_allnodes(np)
672 {
673 if (np->phandle == phandle)
674 {
675 _phandle_hash[poff] = np;
676
677 break;
678 }
679 }
680 }
681 else
682 {
683 rt_ofw_node_get(np);
684 }
685 }
686
687 return np;
688}
689
690struct rt_ofw_node *rt_ofw_get_parent(const struct rt_ofw_node *np)
691{

Callers 10

ofw_pin_ctrl_confs_applyFunction · 0.85
ofw_parse_irq_mapFunction · 0.85
rt_ofw_find_irq_parentFunction · 0.85
rt_ofw_get_irqFunction · 0.85
ofw_map_idFunction · 0.85
ofw_parse_phandle_cellsFunction · 0.85
ofw_device_dma_opsFunction · 0.85
regulator_check_parentFunction · 0.85
rt_regulator_getFunction · 0.85

Calls 1

rt_ofw_node_getFunction · 0.85

Tested by

no test coverage detected