| 123 | } |
| 124 | |
| 125 | int dtb_node_read_u64(const struct dtb_node *dn, const char *propname, uint64_t *outp) |
| 126 | { |
| 127 | const uint64_t *val; |
| 128 | |
| 129 | debug("%s: %s: ", __func__, propname); |
| 130 | if (!dn) |
| 131 | return -EINVAL; |
| 132 | val = dtb_node_find_property_value_of_size(dn, propname, sizeof(*outp)); |
| 133 | if (DTB_IS_ERR(val)) |
| 134 | { |
| 135 | debug("(not found)\n"); |
| 136 | return DTB_PTR_ERR(val); |
| 137 | } |
| 138 | |
| 139 | *outp = fdt64_to_cpu(*val); |
| 140 | debug("%#llx (%lld)\n", (unsigned long long)*outp, |
| 141 | (unsigned long long)*outp); |
| 142 | |
| 143 | return 0; |
| 144 | } |
| 145 | |
| 146 | uint64_t dtb_node_read_u64_default(const struct dtb_node *node, const char *propname, uint64_t def) |
| 147 | { |
no test coverage detected