diff options
author | Frank Rowand <[email protected]> | 2024-02-16 17:05:51 -0800 |
---|---|---|
committer | Rob Herring <[email protected]> | 2024-03-08 12:50:39 -0600 |
commit | 7b937cc243e5b1df8780a0aa743ce800df6c68d1 (patch) | |
tree | 24e9c7b552d99ba89f96c3af21017913e996ec1c /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | dc1460fe1b2dc883195d21759676d55b183fd495 (diff) |
of: Create of_root if no dtb provided by firmware
When enabling CONFIG_OF on a platform where 'of_root' is not populated
by firmware, we end up without a root node. In order to apply overlays
and create subnodes of the root node, we need one. Create this root node
by unflattening an empty builtin dtb.
If firmware provides a flattened device tree (FDT) then the FDT is
unflattened via setup_arch(). Otherwise, the call to
unflatten(_and_copy)?_device_tree() will create an empty root node.
We make of_have_populated_dt() return true only if the DTB was loaded by
firmware so that existing callers don't change behavior after this
patch. The call in the of platform code is removed because it prevents
overlays from creating platform devices when the empty root node is
used.
[[email protected]: Update of_have_populated_dt() to treat this empty dtb
as not populated. Drop setup_of() initcall]
Signed-off-by: Frank Rowand <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: Rob Herring <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions