summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libfdt/libfdt.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index 67fcafb..34c4d55 100644
--- a/libfdt/libfdt.h
+++ b/libfdt/libfdt.h
@@ -524,10 +524,35 @@ int fdt_path_offset_namelen(const void *fdt, const char *path, int namelen);
* level matching the given component, differentiated only by unit
* address).
*
+ * If the path is not absolute (i.e. does not begin with '/'), the
+ * first component is treated as an alias. That is, the property by
+ * that name is looked up in the /aliases node, and the value of that
+ * property used in place of that first component.
+ *
+ * For example, for this small fragment
+ *
+ * / {
+ * aliases {
+ * i2c2 = &foo; // RHS compiles to "/soc@0/i2c@30a40000/eeprom@52"
+ * };
+ * soc@0 {
+ * foo: i2c@30a40000 {
+ * bar: eeprom@52 {
+ * };
+ * };
+ * };
+ * };
+ *
+ * these would be equivalent:
+ *
+ * /soc@0/i2c@30a40000/eeprom@52
+ * i2c2/eeprom@52
+ *
* returns:
* structure block offset of the node with the requested path (>=0), on
* success
- * -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
+ * -FDT_ERR_BADPATH, given path does not begin with '/' and the first
+ * component is not a valid alias
* -FDT_ERR_NOTFOUND, if the requested node does not exist
* -FDT_ERR_BADMAGIC,
* -FDT_ERR_BADVERSION,