* 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. */
| 454 | * parent could not be determined. |
| 455 | */ |
| 456 | static 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 | |
| 480 | int dtb_node_irq_get(struct dtb_node *dev, int index) |
| 481 | { |
no test coverage detected