X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fdtc%2Fdtc-parser.y;h=affc81a8f9abedc2dec26bd8f713aac337e2ac6e;hb=4f7dc2e6037c685a22a81148f0c87005b45181d9;hp=ca3f5003427cb5e280eb6ec4343547f7f37bd428;hpb=2ee87b0c1a5439e4ad6467cb8d5e8fb58922ca4b;p=u-boot diff --git a/scripts/dtc/dtc-parser.y b/scripts/dtc/dtc-parser.y index ca3f500342..affc81a8f9 100644 --- a/scripts/dtc/dtc-parser.y +++ b/scripts/dtc/dtc-parser.y @@ -182,10 +182,19 @@ devicetree: { struct node *target = get_node_by_ref($1, $2); - if (target) + if (target) { merge_nodes(target, $3); - else - ERROR(&@2, "Label or path %s not found", $2); + } else { + /* + * We rely on the rule being always: + * versioninfo plugindecl memreserves devicetree + * so $-1 is what we want (plugindecl) + */ + if ($-1 & DTSF_PLUGIN) + add_orphan_node($1, $3, $2); + else + ERROR(&@2, "Label or path %s not found", $2); + } $$ = $1; } | devicetree DT_DEL_NODE DT_REF ';' @@ -200,6 +209,11 @@ devicetree: $$ = $1; } + | /* empty */ + { + /* build empty node */ + $$ = name_node(build_node(NULL, NULL), ""); + } ; nodedef: