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

Function dtb_node_irq_count

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

* dtb_node_irq_count - Count the number of IRQs a node uses * @dev: pointer to device tree node */

Source from the content-addressed store, hash-verified

543 * @dev: pointer to device tree node
544 */
545int 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}

Callers

nothing calls this directly

Calls 4

dtb_node_irq_find_parentFunction · 0.85
dtb_node_read_u32_arrayFunction · 0.85
dtb_node_read_sizeFunction · 0.85
dtb_node_putFunction · 0.85

Tested by

no test coverage detected