Commit 221a819a authored by Stephen Boyd's avatar Stephen Boyd Committed by Rob Herring

um: Unconditionally call unflatten_device_tree()

Call this function unconditionally so that we can populate an empty DTB
on platforms that don't boot with a command line provided DTB.  There's
no harm in calling unflatten_device_tree() unconditionally. If there
isn't a valid initial_boot_params dtb then unflatten_device_tree()
returns early.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-um@lists.infradead.org
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20240217010557.2381548-4-sboyd@kernel.orgSigned-off-by: default avatarRob Herring <robh@kernel.org>
parent 7b937cc2
...@@ -16,16 +16,16 @@ void uml_dtb_init(void) ...@@ -16,16 +16,16 @@ void uml_dtb_init(void)
void *area; void *area;
area = uml_load_file(dtb, &size); area = uml_load_file(dtb, &size);
if (!area) if (area) {
return; if (!early_init_dt_scan(area)) {
pr_err("invalid DTB %s\n", dtb);
if (!early_init_dt_scan(area)) { memblock_free(area, size);
pr_err("invalid DTB %s\n", dtb); return;
memblock_free(area, size); }
return;
early_init_fdt_scan_reserved_mem();
} }
early_init_fdt_scan_reserved_mem();
unflatten_device_tree(); unflatten_device_tree();
} }
......
...@@ -4087,10 +4087,6 @@ static int __init of_unittest(void) ...@@ -4087,10 +4087,6 @@ static int __init of_unittest(void)
add_taint(TAINT_TEST, LOCKDEP_STILL_OK); add_taint(TAINT_TEST, LOCKDEP_STILL_OK);
/* adding data for unittest */ /* adding data for unittest */
if (IS_ENABLED(CONFIG_UML))
unittest_unflatten_overlay_base();
res = unittest_data_add(); res = unittest_data_add();
if (res) if (res)
return res; return res;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment