summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorGuEe-GUI <[email protected]>2024-09-10 13:28:30 +0800
committerMeco Man <[email protected]>2024-09-13 17:33:29 -0400
commitcb665f932e1ae17c8f0eda14d11ffbf598e2f17a (patch)
treebb1aed7232f2433968a565058eb77d6bf7259dad /components
parent8c456c5e33d65d7655d6911b3f1cda722d6849fe (diff)
[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]>
Diffstat (limited to 'components')
-rw-r--r--components/drivers/ofw/ofw.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/drivers/ofw/ofw.c b/components/drivers/ofw/ofw.c
index 1f9a456aff..f35101ccfe 100644
--- a/components/drivers/ofw/ofw.c
+++ b/components/drivers/ofw/ofw.c
@@ -103,14 +103,14 @@ static struct rt_object *ofw_parse_object(struct rt_ofw_node *np, const char *ce
{
item = &ofw_obj_cmp_list[i];
- if (!rt_strcmp(item->cells_name, cells_name))
- {
- ret_obj = obj;
- break;
- }
-
if (!rt_strncmp(item->obj_name, obj->name, RT_NAME_MAX))
{
+ if (!rt_strcmp(item->cells_name, cells_name))
+ {
+ ret_obj = obj;
+ break;
+ }
+
obj = (struct rt_object *)((rt_ubase_t)obj + item->obj_size);
break;
}
@@ -134,7 +134,7 @@ struct rt_object *rt_ofw_parse_object(struct rt_ofw_node *np, const char *obj_na
if (np && (test_obj = rt_ofw_data(np)) && cells_name)
{
/* The composite object is rare, so we try to find this object as much as possible at once. */
- if (obj_name && rt_strcmp(test_obj->name, obj_name))
+ if (obj_name && !rt_strcmp(test_obj->name, obj_name))
{
obj = test_obj;
}