diff options
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r-- | drivers/of/base.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index ea4be9c512..5644e8e953 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1757,7 +1757,7 @@ int barebox_register_of(struct device_node *root) of_fix_tree(root); if (IS_ENABLED(CONFIG_OFDEVICE)) { - of_clk_init(root, NULL); + of_clk_init(); if (!deep_probe_is_supported()) return of_probe(); } @@ -2318,6 +2318,22 @@ struct property *of_rename_property(struct device_node *np, return pp; } +struct property *of_copy_property(const struct device_node *src, + const char *propname, + struct device_node *dst) +{ + struct property *prop; + + prop = of_find_property(src, propname, NULL); + if (!prop) + return NULL; + + return of_new_property(dst, propname, + of_property_get_value(prop), prop->length); +} +EXPORT_SYMBOL_GPL(of_copy_property); + + /** * of_set_property - create a property for a given node * @node - the node @@ -2513,13 +2529,13 @@ static int of_probe_memory(void) } mem_initcall(of_probe_memory); -struct device *of_platform_device_create_root(struct device_node *np) +static void of_platform_device_create_root(struct device_node *np) { static struct device *dev; int ret; if (dev) - return dev; + return; dev = xzalloc(sizeof(*dev)); dev->id = DEVICE_ID_SINGLE; @@ -2527,12 +2543,8 @@ struct device *of_platform_device_create_root(struct device_node *np) dev_set_name(dev, "machine"); ret = platform_device_register(dev); - if (ret) { + if (ret) free_device(dev); - return ERR_PTR(ret); - } - - return dev; } static const struct of_device_id reserved_mem_matches[] = { |