]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm: core: Set device tree node for root device
authorSimon Glass <sjg@chromium.org>
Sun, 25 Jan 2015 15:26:58 +0000 (08:26 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 30 Jan 2015 00:09:54 +0000 (17:09 -0700)
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: Simon Glass <sjg@chromium.org>
doc/driver-model/README.txt
drivers/core/root.c

index eafa825ab44a00969f27dd805a4a504b59b74720..40415698cf496b7700c6b2e90ac6e55a88afc5a5 100644 (file)
@@ -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,
 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
 ------------------
index 47b3acfbe981da9fcfe5ca6d7c20e60dd63b0285..a5b0a615016fec116960b3bb2c12b6f00dd2f4b8 100644 (file)
@@ -49,6 +49,9 @@ int dm_init(void)
        ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
        if (ret)
                return ret;
+#ifdef CONFIG_OF_CONTROL
+       DM_ROOT_NON_CONST->of_offset = 0;
+#endif
        ret = device_probe(DM_ROOT_NON_CONST);
        if (ret)
                return ret;