Commit 2f3b95dbc78ce96b0f9f471e688db66223988419

Authored by Simon Glass
1 parent 040b69af72

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: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 7 additions and 0 deletions Side-by-side Diff

doc/driver-model/README.txt
... ... @@ -363,6 +363,10 @@
363 363 in your ofdata_to_platdata (or probe) method to allocate the required memory,
364 364 and you should free it in the remove method.
365 365  
  366 +The driver model tree is intended to mirror that of the device tree. The
  367 +root driver is at device tree offset 0 (the root node, '/'), and its
  368 +children are the children of the root node.
  369 +
366 370  
367 371 Declaring Uclasses
368 372 ------------------
... ... @@ -49,6 +49,9 @@
49 49 ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
50 50 if (ret)
51 51 return ret;
  52 +#ifdef CONFIG_OF_CONTROL
  53 + DM_ROOT_NON_CONST->of_offset = 0;
  54 +#endif
52 55 ret = device_probe(DM_ROOT_NON_CONST);
53 56 if (ret)
54 57 return ret;