* dtb_node_irq_count - Count the number of IRQs a node uses * @dev: pointer to device tree node */
| 543 | * @dev: pointer to device tree node |
| 544 | */ |
| 545 | int dtb_node_irq_count(struct dtb_node *device) |
| 546 | { |
| 547 | struct dtb_node *p; |
| 548 | uint32_t intsize; |
| 549 | int nr = 0, res = 0; |
| 550 | |
| 551 | p = dtb_node_irq_find_parent(device); |
| 552 | if (p == NULL) |
| 553 | return -EINVAL; |
| 554 | |
| 555 | /* Get size of interrupt specifier */ |
| 556 | if (dtb_node_read_u32_array(p, "#interrupt-cells", &intsize, 1)) |
| 557 | { |
| 558 | res = -EINVAL; |
| 559 | goto out; |
| 560 | } |
| 561 | |
| 562 | debug(" path:%s, parent=%pOF, intsize=%d\n", p->path,p, intsize); |
| 563 | |
| 564 | res = dtb_node_read_size(device, "interrupts"); |
| 565 | if (res < 0) |
| 566 | { |
| 567 | goto out; |
| 568 | } |
| 569 | nr = res / (intsize * 4); |
| 570 | out: |
| 571 | dtb_node_put(p); |
| 572 | |
| 573 | return nr; |
| 574 | } |
nothing calls this directly
no test coverage detected