Rev 1899 | Rev 1972 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1899 | Rev 1908 | ||
|---|---|---|---|
| Line 145... | Line 145... | ||
| 145 | } |
145 | } |
| 146 | 146 | ||
| 147 | return NULL; |
147 | return NULL; |
| 148 | } |
148 | } |
| 149 | 149 | ||
| - | 150 | /** Lookup node with matching node_handle. |
|
| - | 151 | * |
|
| - | 152 | * @param root Root of the searched subtree. |
|
| - | 153 | * @param handle OpenFirmware handle. |
|
| - | 154 | * |
|
| - | 155 | * @return NULL if there is no such node or pointer to the matching node. |
|
| - | 156 | */ |
|
| - | 157 | ofw_tree_node_t *ofw_tree_find_node_by_handle(ofw_tree_node_t *root, uint32_t handle) |
|
| - | 158 | { |
|
| - | 159 | ofw_tree_node_t *node; |
|
| - | 160 | ||
| - | 161 | if (root->node_handle == handle) |
|
| - | 162 | return root; |
|
| - | 163 | ||
| - | 164 | if (root->peer) { |
|
| - | 165 | node = ofw_tree_find_node_by_handle(root->peer, handle); |
|
| - | 166 | if (node) |
|
| - | 167 | return node; |
|
| - | 168 | } |
|
| - | 169 | ||
| - | 170 | if (root->child) { |
|
| - | 171 | node = ofw_tree_find_node_by_handle(root->child, handle); |
|
| - | 172 | if (node) |
|
| - | 173 | return node; |
|
| - | 174 | } |
|
| - | 175 | ||
| - | 176 | return NULL; |
|
| - | 177 | } |
|
| - | 178 | ||
| 150 | /** Lookup first peer of given device type. |
179 | /** Lookup first peer of given device type. |
| 151 | * |
180 | * |
| 152 | * @param node Node whose peer is being looked up. |
181 | * @param node Node whose peer is being looked up. |
| 153 | * @param name Device type of the child being looked up. |
182 | * @param name Device type of the child being looked up. |
| 154 | * |
183 | * |