aboutsummaryrefslogtreecommitdiff
path: root/tests/trees.S
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-09-28 15:51:04 +1000
committerJon Loeliger <jdl@freescale.com>2007-10-15 08:27:24 -0500
commitd2a9da045897c37071597d9aa473964717b14735 (patch)
tree0c80c6a8906795c4a86721b44940bfd5eb6e253c /tests/trees.S
parent02a5556850bbb64a73cd45b2dbca6579880bb424 (diff)
downloaddtc-d2a9da045897c37071597d9aa473964717b14735.zip
dtc-d2a9da045897c37071597d9aa473964717b14735.tar.gz
dtc-d2a9da045897c37071597d9aa473964717b14735.tar.bz2
libfdt: Make unit address optional for finding nodes
At present, the fdt_subnode_offset() and fdt_path_offset() functions in libfdt require the exact name of the nodes in question be passed, including unit address. This is contrary to traditional OF-like finddevice() behaviour, which allows the unit address to be omitted (which is useful when the device name is unambiguous without the address). This patch introduces similar behaviour to fdt_subnode_offset_namelen(), and hence to fdt_subnode_offset() and fdt_path_offset() which are implemented in terms of the former. The unit address can be omitted from the given node name. If this is ambiguous, the first such node in the flattened tree will be selected (this behaviour is consistent with IEEE1275 which specifies only that an arbitrary node matching the given information be selected). This very small change is then followed by many more diffs which change the test examples and testcases to exercise this behaviour. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tests/trees.S')
-rw-r--r--tests/trees.S6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/trees.S b/tests/trees.S
index 60e1b55..78c92d7 100644
--- a/tests/trees.S
+++ b/tests/trees.S
@@ -78,7 +78,7 @@ test_tree1_struct:
PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
PROP_STR(test_tree1, prop_str, TEST_STRING_1)
- BEGIN_NODE("subnode1")
+ BEGIN_NODE("subnode@1")
PROP_INT(test_tree1, prop_int, TEST_VALUE_1)
BEGIN_NODE("subsubnode")
@@ -86,10 +86,10 @@ test_tree1_struct:
END_NODE
END_NODE
- BEGIN_NODE("subnode2")
+ BEGIN_NODE("subnode@2")
PROP_INT(test_tree1, prop_int, TEST_VALUE_2)
- BEGIN_NODE("subsubnode")
+ BEGIN_NODE("subsubnode@0")
PROP_INT(test_tree1, prop_int, TEST_VALUE_2)
END_NODE
END_NODE