| 77 | } |
| 78 | |
| 79 | int rt_ofw_get_address_count(struct rt_ofw_node *np) |
| 80 | { |
| 81 | int count; |
| 82 | |
| 83 | if (np) |
| 84 | { |
| 85 | rt_ssize_t len; |
| 86 | |
| 87 | count = 0; |
| 88 | |
| 89 | if (rt_ofw_get_prop(np, "reg", &len)) |
| 90 | { |
| 91 | count = len / (sizeof(fdt32_t) * (rt_ofw_io_addr_cells(np) + rt_ofw_io_size_cells(np))); |
| 92 | } |
| 93 | } |
| 94 | else |
| 95 | { |
| 96 | count = -RT_EINVAL; |
| 97 | } |
| 98 | |
| 99 | return count; |
| 100 | } |
| 101 | |
| 102 | static rt_err_t ofw_get_address(struct rt_ofw_node *np, int index, rt_uint64_t *out_address, rt_uint64_t *out_size) |
| 103 | { |
no test coverage detected