Browse Source
At present, both the grammar and our internal data structures mean that there can be only one label on a node or property. This is a fairly arbitrary constraint, given that any number of value labels can appear at the same point, and that in C you can have any number of labels on the same statement. This is pretty much a non-issue now, but it may become important with some of the extensions that Grant and I have in mind. It's not that hard to change, so this patch does so, allowing an arbitrary number of labels on any given node or property. As usual a testcase is added too. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Grant Likely <grant.likely@secretlab.ca>main


9 changed files with 157 additions and 89 deletions
@ -0,0 +1,38 @@ |
|||||||
|
/dts-v1/; |
||||||
|
|
||||||
|
m1: mq: /memreserve/ 0 0x1000; |
||||||
|
|
||||||
|
/ { |
||||||
|
p1: px: prop = "foo"; |
||||||
|
|
||||||
|
/* Explicit phandles */ |
||||||
|
n1: nx: node1 { |
||||||
|
linux,phandle = <0x2000>; |
||||||
|
ref = <&{/node2}>; /* reference precedes target */ |
||||||
|
lref = <&ny>; |
||||||
|
}; |
||||||
|
ny: n2: node2 { |
||||||
|
phandle = <0x1>; |
||||||
|
ref = <&{/node1}>; /* reference after target */ |
||||||
|
lref = <&nx>; |
||||||
|
}; |
||||||
|
|
||||||
|
/* Implicit phandles */ |
||||||
|
n3: node3 { |
||||||
|
ref = <&{/node4}>; |
||||||
|
lref = <&n4>; |
||||||
|
}; |
||||||
|
n4: node4 { |
||||||
|
}; |
||||||
|
|
||||||
|
/* Explicit phandle with implicit value */ |
||||||
|
/* This self-reference is the standard way to tag a node as requiring |
||||||
|
* a phandle (perhaps for reference by nodes that will be dynamically |
||||||
|
* added) without explicitly allocating it a phandle. |
||||||
|
* The self-reference requires some special internal handling, though |
||||||
|
* so check it actually works */ |
||||||
|
n5: nz: node5 { |
||||||
|
linux,phandle = <&n5>; |
||||||
|
phandle = <&nz>; |
||||||
|
}; |
||||||
|
}; |
Loading…
Reference in new issue