Rev 3343 | Rev 3618 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3343 | Rev 3582 | ||
|---|---|---|---|
| Line 200... | Line 200... | ||
| 200 | 200 | ||
| 201 | return NULL; |
201 | return NULL; |
| 202 | } |
202 | } |
| 203 | 203 | ||
| 204 | 204 | ||
| - | 205 | /** Lookup first peer of given name. |
|
| - | 206 | * |
|
| - | 207 | * @param node Node whose peer is being looked up. |
|
| - | 208 | * @param name Name of the child being looked up. |
|
| - | 209 | * |
|
| - | 210 | * @return NULL if there is no such peer or pointer to the matching peer node. |
|
| - | 211 | */ |
|
| - | 212 | ofw_tree_node_t *ofw_tree_find_peer_by_name(ofw_tree_node_t *node, const char *name) |
|
| - | 213 | { |
|
| - | 214 | ofw_tree_node_t *cur; |
|
| - | 215 | ofw_tree_property_t *prop; |
|
| - | 216 | ||
| - | 217 | for (cur = node->peer; cur; cur = cur->peer) { |
|
| - | 218 | prop = ofw_tree_getprop(cur, "name"); |
|
| - | 219 | if (!prop || !prop->value) |
|
| - | 220 | continue; |
|
| - | 221 | if (strcmp(prop->value, name) == 0) |
|
| - | 222 | return cur; |
|
| - | 223 | } |
|
| - | 224 | ||
| - | 225 | return NULL; |
|
| - | 226 | } |
|
| - | 227 | ||
| 205 | /** Lookup OpenFirmware node by its path. |
228 | /** Lookup OpenFirmware node by its path. |
| 206 | * |
229 | * |
| 207 | * @param path Path to the node. |
230 | * @param path Path to the node. |
| 208 | * |
231 | * |
| 209 | * @return NULL if there is no such node or pointer to the leaf node. |
232 | * @return NULL if there is no such node or pointer to the leaf node. |