aboutsummaryrefslogtreecommitdiff
path: root/src/lib/device_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/device_tree.c')
-rw-r--r--src/lib/device_tree.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/device_tree.c b/src/lib/device_tree.c
index 3e1dd3580c..e26021e9ee 100644
--- a/src/lib/device_tree.c
+++ b/src/lib/device_tree.c
@@ -556,7 +556,7 @@ struct device_tree_node *dt_find_node(struct device_tree_node *parent,
*
* @param tree The device tree to search.
* @param path A string representing a path in the device tree, with
- * nodes separated by '/'. Example: "soc/firmware/coreboot"
+ * nodes separated by '/'. Example: "/firmware/coreboot"
* @param addrcp Pointer that will be updated with any #address-cells
* value found in the path. May be NULL to ignore.
* @param sizecp Pointer that will be updated with any #size-cells
@@ -565,13 +565,13 @@ struct device_tree_node *dt_find_node(struct device_tree_node *parent,
* @return The found/created node, or NULL.
*
* It is the caller responsibility to provide the correct path string, namely
- * not starting or ending with a '/', and not having "//" anywhere in it.
+ * starting with a '/', not ending in a '/' and not having "//" anywhere in it.
*/
struct device_tree_node *dt_find_node_by_path(struct device_tree *tree,
const char *path, u32 *addrcp,
u32 *sizecp, int create)
{
- char *dup_path = strdup(path);
+ char *dup_path = strdup(&path[1]); /* remove leading '/' */
/* Hopefully enough depth for any node. */
const char *path_array[15];
int i;
@@ -995,7 +995,7 @@ struct device_tree_node *dt_init_reserved_memory_node(struct device_tree *tree)
struct device_tree_node *reserved;
u32 addr = 0, size = 0;
- reserved = dt_find_node_by_path(tree, "reserved-memory", &addr,
+ reserved = dt_find_node_by_path(tree, "/reserved-memory", &addr,
&size, 1);
if (!reserved)
return NULL;