dt: add of_alias_scan and of_alias_get_id

The patch adds function of_alias_scan to populate a global lookup
table with the properties of 'aliases' node and function
of_alias_get_id for drivers to find alias id from the lookup table.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
[grant.likely: add locking and rework parse loop]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
This commit is contained in:
Shawn Guo
2011-08-03 11:28:14 +01:00
zatwierdzone przez Grant Likely
rodzic ed8f37370d
commit 750f463a74
4 zmienionych plików z 141 dodań i 2 usunięć

Wyświetl plik

@@ -707,10 +707,12 @@ void __init unflatten_device_tree(void)
__unflatten_device_tree(initial_boot_params, &allnodes,
early_init_dt_alloc_memory_arch);
/* Get pointer to OF "/chosen" node for use everywhere */
/* Get pointer to "/chosen" and "/aliasas" nodes for use everywhere */
of_chosen = of_find_node_by_path("/chosen");
if (of_chosen == NULL)
of_chosen = of_find_node_by_path("/chosen@0");
of_aliases = of_find_node_by_path("/aliases");
of_alias_scan();
}
#endif /* CONFIG_OF_EARLY_FLATTREE */