[PATCH 2/3] of: fdt: rename /memreserve special node to /$memreserve
Ahmad Fatoum
a.fatoum at pengutronix.de
Thu Dec 19 03:16:02 PST 2024
/memreserve in the barebox device tree is a special node used to hold
the reserved memory entries in the FDT until the DT is unflattened
again.
To avoid conflicts with an actual device tree node called /memreserve,
let's prefix with '$', the character newly chosen to mark
barebox-specific nodes and properties.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
drivers/of/fdt.c | 14 ++++++--------
drivers/of/reserved-mem.c | 2 +-
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 6f10094143cd..6c554af61f6f 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -92,7 +92,7 @@ static int of_reservemap_num_entries(const struct fdt_header *fdt)
* @fdt - the flattened device tree blob
*
* This stores the memreserve entries from the dtb in a newly created
- * /memserve node in the unflattened device tree. The device tree
+ * /$memreserve node in the unflattened device tree. The device tree
* flatten code moves the entries back to the /memreserve/ area in the
* flattened tree.
*
@@ -109,7 +109,7 @@ static int of_unflatten_reservemap(struct device_node *root,
if (n <= 0)
return n;
- memreserve = of_new_node(root, "memreserve");
+ memreserve = of_new_node(root, "$memreserve");
if (!memreserve)
return -ENOMEM;
@@ -462,7 +462,7 @@ static inline int dt_add_string(struct fdt *fdt, const char *str)
return ret;
}
-static int __of_flatten_dtb(struct fdt *fdt, struct device_node *node, int is_root)
+static int __of_flatten_dtb(struct fdt *fdt, struct device_node *node)
{
struct property *p;
struct device_node *n;
@@ -500,10 +500,8 @@ static int __of_flatten_dtb(struct fdt *fdt, struct device_node *node, int is_ro
list_for_each_entry(n, &node->children, parent_list) {
if (is_reserved_name(n->name))
continue;
- if (is_root && !strcmp(n->name, "memreserve"))
- continue;
- ret = __of_flatten_dtb(fdt, n, 0);
+ ret = __of_flatten_dtb(fdt, n);
if (ret)
return ret;
}
@@ -553,11 +551,11 @@ void *of_flatten_dtb(struct device_node *node)
fdt.dt_nextofs = ofs;
- ret = __of_flatten_dtb(&fdt, node, 1);
+ ret = __of_flatten_dtb(&fdt, node);
if (ret)
goto out_free;
- memreserve = of_find_node_by_name_address(node, "memreserve");
+ memreserve = of_find_node_by_name_address(node, "$memreserve");
if (memreserve) {
const void *entries = of_get_property(memreserve, "reg", &len);
diff --git a/drivers/of/reserved-mem.c b/drivers/of/reserved-mem.c
index 599a7c968afd..b278026617ac 100644
--- a/drivers/of/reserved-mem.c
+++ b/drivers/of/reserved-mem.c
@@ -52,7 +52,7 @@ static int of_reserved_mem_walk(void)
}
}
- node = of_find_node_by_path("/memreserve");
+ node = of_find_node_by_path("/$memreserve");
reg = of_get_property(node, "reg", &ncells);
ncells /= sizeof(__be32);
if (reg) {
--
2.39.5
More information about the barebox
mailing list