/* Returns a pointer to the interrupt parent node, or NULL if the interrupt parent could not be determined.  */
static struct dtb_node* dtb_node_irq_find_parent(struct dtb_node *child)
/* Returns a pointer to the interrupt parent node, or NULL if the interrupt parent could not be determined.  */
static struct dtb_node* dtb_node_irq_find_parent(struct dtb_node *child)
{
    struct dtb_node *p;
    phandle parent;
    if (!dtb_node_get(child))
        return NULL;
    do
    {
        if (dtb_node_read_u32_array(child, "interrupt-parent", &parent, 1))
        {
            p = dtb_node_get_parent(child);
        }
        else
        {
            p = dtb_node_get_by_phandle(parent);
        }
        dtb_node_put(child);
        child = p;
    } while (p && dtb_node_get_property(p, "#interrupt-cells", NULL) == NULL);
    return p;
}