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

Function rt_ofw_count_phandle_cells

components/drivers/ofw/base.c:1566–1601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1564}
1565
1566int rt_ofw_count_phandle_cells(const struct rt_ofw_node *np, const char *list_name, const char *cells_name)
1567{
1568 int count;
1569
1570 if (np && list_name)
1571 {
1572 count = -1;
1573
1574 if (!cells_name)
1575 {
1576 rt_ssize_t length;
1577
1578 if (rt_ofw_get_prop(np, list_name, &length))
1579 {
1580 count = length / sizeof(fdt32_t);
1581 }
1582 }
1583 else
1584 {
1585 int index = count = 0;
1586 struct rt_ofw_cell_args args;
1587
1588 while (!ofw_parse_phandle_cells(np, list_name, cells_name, index, &args))
1589 {
1590 ++index;
1591 ++count;
1592 }
1593 }
1594 }
1595 else
1596 {
1597 count = -RT_EINVAL;
1598 }
1599
1600 return count;
1601}
1602
1603static const char *ofw_get_prop_fuzzy_name(const struct rt_ofw_node *np, const char *name)
1604{

Callers 4

ofw_get_reset_controlFunction · 0.85
rt_ofw_get_clk_arrayFunction · 0.85
thermal_ofw_setupFunction · 0.85

Calls 2

rt_ofw_get_propFunction · 0.85
ofw_parse_phandle_cellsFunction · 0.85

Tested by

no test coverage detected