Skip to content

Commit cb665f9

Browse files
GuEe-GUImysterywolf
authored andcommitted
[FIXUP/OFW] ofw_parse_object fail
The ofw parse should: 1. Check obj_name EQU the current node's rt_data. 2. Find the next object name. 3. goto "2" until obj_name EQU the cmp_cell's obj_name. Signed-off-by: GuEe-GUI <[email protected]>
1 parent 8c456c5 commit cb665f9

File tree

1 file changed

+7
-7
lines changed
  • components/drivers/ofw

1 file changed

+7
-7
lines changed

components/drivers/ofw/ofw.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ static struct rt_object *ofw_parse_object(struct rt_ofw_node *np, const char *ce
103103
{
104104
item = &ofw_obj_cmp_list[i];
105105

106-
if (!rt_strcmp(item->cells_name, cells_name))
107-
{
108-
ret_obj = obj;
109-
break;
110-
}
111-
112106
if (!rt_strncmp(item->obj_name, obj->name, RT_NAME_MAX))
113107
{
108+
if (!rt_strcmp(item->cells_name, cells_name))
109+
{
110+
ret_obj = obj;
111+
break;
112+
}
113+
114114
obj = (struct rt_object *)((rt_ubase_t)obj + item->obj_size);
115115
break;
116116
}
@@ -134,7 +134,7 @@ struct rt_object *rt_ofw_parse_object(struct rt_ofw_node *np, const char *obj_na
134134
if (np && (test_obj = rt_ofw_data(np)) && cells_name)
135135
{
136136
/* The composite object is rare, so we try to find this object as much as possible at once. */
137-
if (obj_name && rt_strcmp(test_obj->name, obj_name))
137+
if (obj_name && !rt_strcmp(test_obj->name, obj_name))
138138
{
139139
obj = test_obj;
140140
}

0 commit comments

Comments
 (0)