Skip to content
Snippets Groups Projects
Commit 2f3b95db authored by Simon Glass's avatar Simon Glass
Browse files

dm: core: Set device tree node for root device


The root device corresponds to the root device tree node, so set this up.
Also add a few notes to the documentation.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 040b69af
No related branches found
No related tags found
No related merge requests found
...@@ -363,6 +363,10 @@ can leave out platdata_auto_alloc_size. In this case you can use malloc ...@@ -363,6 +363,10 @@ can leave out platdata_auto_alloc_size. In this case you can use malloc
in your ofdata_to_platdata (or probe) method to allocate the required memory, in your ofdata_to_platdata (or probe) method to allocate the required memory,
and you should free it in the remove method. and you should free it in the remove method.
The driver model tree is intended to mirror that of the device tree. The
root driver is at device tree offset 0 (the root node, '/'), and its
children are the children of the root node.
Declaring Uclasses Declaring Uclasses
------------------ ------------------
......
...@@ -49,6 +49,9 @@ int dm_init(void) ...@@ -49,6 +49,9 @@ int dm_init(void)
ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST); ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
if (ret) if (ret)
return ret; return ret;
#ifdef CONFIG_OF_CONTROL
DM_ROOT_NON_CONST->of_offset = 0;
#endif
ret = device_probe(DM_ROOT_NON_CONST); ret = device_probe(DM_ROOT_NON_CONST);
if (ret) if (ret)
return ret; return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment