Changeset 45b26dad in mainline for kernel/genarch/src/ofw/ofw_tree.c
- Timestamp:
- 2006-09-26T12:59:28Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b44939b
- Parents:
- 6ff1f1e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/ofw/ofw_tree.c
r6ff1f1e r45b26dad 98 98 * @return NULL if there is no such child or pointer to the matching child node. 99 99 */ 100 staticofw_tree_node_t *ofw_tree_find_child(ofw_tree_node_t *node, const char *name)100 ofw_tree_node_t *ofw_tree_find_child(ofw_tree_node_t *node, const char *name) 101 101 { 102 102 ofw_tree_node_t *cur; … … 125 125 } 126 126 127 /** Lookup first child of given device type. 128 * 129 * @param node Node whose child is being looked up. 130 * @param name Device type of the child being looked up. 131 * 132 * @return NULL if there is no such child or pointer to the matching child node. 133 */ 134 ofw_tree_node_t *ofw_tree_find_child_by_device_type(ofw_tree_node_t *node, const char *name) 135 { 136 ofw_tree_node_t *cur; 137 ofw_tree_property_t *prop; 138 139 for (cur = node->child; cur; cur = cur->peer) { 140 prop = ofw_tree_getprop(cur, "device_type"); 141 if (!prop || !prop->value) 142 continue; 143 if (strcmp(prop->value, name) == 0) 144 return cur; 145 } 146 147 return NULL; 148 } 149 150 /** Lookup first peer of given device type. 151 * 152 * @param node Node whose peer is being looked up. 153 * @param name Device type of the child being looked up. 154 * 155 * @return NULL if there is no such child or pointer to the matching child node. 156 */ 157 ofw_tree_node_t *ofw_tree_find_peer_by_device_type(ofw_tree_node_t *node, const char *name) 158 { 159 ofw_tree_node_t *cur; 160 ofw_tree_property_t *prop; 161 162 for (cur = node->peer; cur; cur = cur->peer) { 163 prop = ofw_tree_getprop(cur, "device_type"); 164 if (!prop || !prop->value) 165 continue; 166 if (strcmp(prop->value, name) == 0) 167 return cur; 168 } 169 170 return NULL; 171 } 172 173 127 174 /** Lookup OpenFirmware node by its path. 128 175 *
Note:
See TracChangeset
for help on using the changeset viewer.