diff options
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r-- | drivers/of/base.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 95bea4ee83..3ca13ae44e 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1938,8 +1938,8 @@ int of_probe(void) if (memory) of_add_memory(memory, false); - of_platform_populate(root_node, of_default_bus_match_table, NULL); of_clk_init(root_node, NULL); + of_platform_populate(root_node, of_default_bus_match_table, NULL); return 0; } @@ -1988,6 +1988,22 @@ out: return dn; } +struct device_node *of_copy_node(struct device_node *parent, const struct device_node *other) +{ + struct device_node *np, *child; + struct property *pp; + + np = of_new_node(parent, other->name); + + list_for_each_entry(pp, &other->properties, list) + of_new_property(np, pp->name, pp->value, pp->length); + + for_each_child_of_node(other, child) + of_copy_node(np, child); + + return np; +} + void of_delete_node(struct device_node *node) { struct device_node *n, *nt; |