@@ -51,7 +51,7 @@ static void free_name(const char *name)
free((char *)name);
}
-static struct pdbg_target *new_node(const char *name, const void *fdt, int node_offset)
+struct pdbg_target *dt_new_node(const char *name, const void *fdt, int node_offset)
{
struct hw_unit_info *hw_info = NULL;
const struct fdt_property *prop;
@@ -108,11 +108,6 @@ static struct pdbg_target *new_node(const char *name, const void *fdt, int node_
return node;
}
-struct pdbg_target *dt_new_root(const char *name, const void *fdt, int offset)
-{
- return new_node(name, fdt, offset);
-}
-
static const char *get_unitname(const struct pdbg_target *node)
{
const char *c = strchr(node->dn_name, '@');
@@ -771,7 +766,7 @@ int dt_expand_node(struct pdbg_target *node, const void *fdt, int fdt_node)
break;
case FDT_BEGIN_NODE:
name = fdt_get_name(fdt, offset, NULL);
- child = dt_new_root(name, fdt, offset);
+ child = dt_new_node(name, fdt, offset);
assert(child);
nextoffset = dt_expand_node(child, fdt, offset);
@@ -46,8 +46,8 @@ extern u32 last_phandle;
extern struct pdbg_target *dt_root;
extern struct pdbg_target *dt_chosen;
-/* Create a root node: ie. a parentless one. */
-struct pdbg_target *dt_new_root(const char *name, const void *fdt, int offset);
+/* Create a new node. */
+struct pdbg_target *dt_new_node(const char *name, const void *fdt, int offset);
/* Graft a root node into this tree. */
bool dt_attach_root(struct pdbg_target *parent, struct pdbg_target *root);
@@ -276,7 +276,7 @@ struct hw_unit_info *find_compatible_target(const char *compat)
void pdbg_targets_init(void *fdt)
{
- dt_root = dt_new_root("", NULL, 0);
+ dt_root = dt_new_node("", NULL, 0);
dt_expand(fdt);
}
dt_new_root is not really creating a new root node. It's just creating a new node that is not attached to the tree. Signed-off-by: Amitay Isaacs <amitay@ozlabs.org> --- libpdbg/device.c | 9 ++------- libpdbg/device.h | 4 ++-- libpdbg/target.c | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-)