MCPcopy Create free account
hub / github.com/F-Stack/f-stack / of_get_next_child

Function of_get_next_child

dpdk/drivers/common/dpaax/dpaa_of.c:388–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388const struct device_node *
389of_get_next_child(const struct device_node *dev_node,
390 const struct device_node *prev)
391{
392 const struct dt_dir *p, *c;
393
394 DPAAX_HWWARN(!alive, "Device-tree driver not initialised!");
395
396 if (!dev_node)
397 return NULL;
398 p = node2dir(dev_node);
399 if (prev) {
400 c = node2dir(prev);
401 DPAAX_HWWARN((c->parent != p), "Parent/child mismatch");
402 if (c->parent != p)
403 return NULL;
404 if (c->node.list.next == &p->subdirs)
405 /* prev was the last child */
406 return NULL;
407 c = list_entry(c->node.list.next, struct dt_dir, node.list);
408 return &c->node.node;
409 }
410 /* Return first child */
411 if (list_empty(&p->subdirs))
412 return NULL;
413 c = list_entry(p->subdirs.next, struct dt_dir, node.list);
414 return &c->node.node;
415}
416
417uint32_t
418of_n_addr_cells(const struct device_node *dev_node)

Callers 1

Calls 2

node2dirFunction · 0.85
list_emptyFunction · 0.85

Tested by

no test coverage detected