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

Function dtb_node_irq_find_parent

components/legacy/fdt/src/dtb_base.c:456–478  ·  view source on GitHub ↗

* dtb_node_irq_find_parent - Given a device node, find its interrupt parent node * @child: pointer to device node * * Returns a pointer to the interrupt parent node, or NULL if the interrupt * parent could not be determined. */

Source from the content-addressed store, hash-verified

454 * parent could not be determined.
455 */
456static struct dtb_node *dtb_node_irq_find_parent(struct dtb_node *child)
457{
458 struct dtb_node *p;
459 phandle parent;
460
461 if (!dtb_node_get(child))
462 return NULL;
463 do
464 {
465 if (dtb_node_read_u32_array(child, "interrupt-parent", &parent, 1))
466 {
467 p = dtb_node_get_parent(child);
468 }
469 else
470 {
471 p = dtb_node_get_by_phandle(parent);
472 }
473 dtb_node_put(child);
474 child = p;
475 } while (p && dtb_node_get_property(p, "#interrupt-cells", NULL) == NULL);
476
477 return p;
478}
479
480int dtb_node_irq_get(struct dtb_node *dev, int index)
481{

Callers 2

dtb_node_irq_getFunction · 0.85
dtb_node_irq_countFunction · 0.85

Calls 5

dtb_node_read_u32_arrayFunction · 0.85
dtb_node_get_parentFunction · 0.85
dtb_node_get_by_phandleFunction · 0.85
dtb_node_putFunction · 0.85
dtb_node_get_propertyFunction · 0.85

Tested by

no test coverage detected