| 1564 | } |
| 1565 | |
| 1566 | int 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 | |
| 1603 | static const char *ofw_get_prop_fuzzy_name(const struct rt_ofw_node *np, const char *name) |
| 1604 | { |
no test coverage detected