dtc: Generate useful error message for properties after subnodes

On several occasions, I've accidentally put properties after subnodes
in a dts file.  I've then spent ages thinking that the resulting
syntax error was because of something else.

This patch arranges for this specific syntax error to generate a more
specific and useful error message.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
David Gibson 2007-12-05 10:27:04 +11:00 committed by Jon Loeliger
parent 2b67c632df
commit c048102f5b
2 changed files with 14 additions and 0 deletions

View File

@ -276,6 +276,11 @@ subnodes:
{
$$ = chain_node($1, $2);
}
| subnode propdef
{
yyerror("syntax error: properties must precede subnodes\n");
YYERROR;
}
;

subnode:

View File

@ -0,0 +1,9 @@
/dts-v1/;

/ {
node1 {
};
prop;
node2 {
};
};