Rev 3672 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3672 | Rev 3796 | ||
|---|---|---|---|
| Line 80... | Line 80... | ||
| 80 | static void ofw_tree_node_process(ofw_tree_node_t *current_node, |
80 | static void ofw_tree_node_process(ofw_tree_node_t *current_node, |
| 81 | ofw_tree_node_t *parent_node, phandle current) |
81 | ofw_tree_node_t *parent_node, phandle current) |
| 82 | { |
82 | { |
| 83 | static char path[MAX_PATH_LEN+1]; |
83 | static char path[MAX_PATH_LEN+1]; |
| 84 | static char name[OFW_TREE_PROPERTY_MAX_NAMELEN]; |
84 | static char name[OFW_TREE_PROPERTY_MAX_NAMELEN]; |
| - | 85 | static char name2[OFW_TREE_PROPERTY_MAX_NAMELEN]; |
|
| 85 | phandle peer; |
86 | phandle peer; |
| 86 | phandle child; |
87 | phandle child; |
| 87 | size_t len; |
88 | size_t len; |
| 88 | int i; |
89 | int i; |
| 89 | 90 | ||
| Line 137... | Line 138... | ||
| 137 | 138 | ||
| 138 | /* |
139 | /* |
| 139 | * Count properties. |
140 | * Count properties. |
| 140 | */ |
141 | */ |
| 141 | name[0] = '\0'; |
142 | name[0] = '\0'; |
| 142 | while (ofw_next_property(current, name, name) == 1) |
143 | while (ofw_next_property(current, name, name2) == 1) { |
| 143 | current_node->properties++; |
144 | current_node->properties++; |
| - | 145 | memcpy(name, name2, OFW_TREE_PROPERTY_MAX_NAMELEN); |
|
| - | 146 | } |
|
| 144 | 147 | ||
| 145 | if (!current_node->properties) |
148 | if (!current_node->properties) |
| 146 | return; |
149 | return; |
| 147 | 150 | ||
| 148 | /* |
151 | /* |
| 149 | * Copy properties. |
152 | * Copy properties. |
| Line 151... | Line 154... | ||
| 151 | current_node->property = ofw_tree_properties_alloc(current_node->properties); |
154 | current_node->property = ofw_tree_properties_alloc(current_node->properties); |
| 152 | if (!current_node->property) |
155 | if (!current_node->property) |
| 153 | return; |
156 | return; |
| 154 | 157 | ||
| 155 | name[0] = '\0'; |
158 | name[0] = '\0'; |
| 156 | for (i = 0; ofw_next_property(current, name, name) == 1; i++) { |
159 | for (i = 0; ofw_next_property(current, name, name2) == 1; i++) { |
| 157 | size_t size; |
160 | size_t size; |
| 158 | 161 | ||
| 159 | if (i == current_node->properties) |
162 | if (i == current_node->properties) |
| 160 | break; |
163 | break; |
| 161 | 164 | ||
| - | 165 | memcpy(name, name2, OFW_TREE_PROPERTY_MAX_NAMELEN); |
|
| 162 | memcpy(current_node->property[i].name, name, |
166 | memcpy(current_node->property[i].name, name, |
| 163 | OFW_TREE_PROPERTY_MAX_NAMELEN); |
167 | OFW_TREE_PROPERTY_MAX_NAMELEN); |
| 164 | current_node->property[i].name[OFW_TREE_PROPERTY_MAX_NAMELEN] = '\0'; |
168 | current_node->property[i].name[OFW_TREE_PROPERTY_MAX_NAMELEN] = '\0'; |
| 165 | 169 | ||
| 166 | size = ofw_get_proplen(current, name); |
170 | size = ofw_get_proplen(current, name); |