diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-11-25 17:10:38 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-07 15:03:31 +0100 |
commit | 307c140cb12e28cafe44b3225c4521d716a6ec02 (patch) | |
tree | 043e1eb99b3699a78dd3f431938855901876e34e | |
parent | 863a2251393e5ee5ecdd6d696ee0e23c3b945f9a (diff) | |
download | barebox-307c140cb12e28cafe44b3225c4521d716a6ec02.tar.gz barebox-307c140cb12e28cafe44b3225c4521d716a6ec02.tar.xz |
of: overlay: rescan aliases calling of_overlay_apply_tree on live tree
Couple of drivers in-tree, like state, depend on aliases for correct
operation. If state node is added via overlay and oftree -p is called,
driver would start probing, but fail because aliases weren't reloaded.
Fix this corner case by always just calling of_alias_scan() on every
successful of_overlay_apply_tree to the live tree. No functional change
yet, as the only user of this function is overlay application code of
ARM QEMU machine, which happens at pure_initcall level, making
of_alias_scan a no-op. Follow-up commit will move overlay application to
happen after device tree is registered, necessitating this change.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20211125161042.3829996-4-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/of/overlay.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index e6f6634d60..20a43f5170 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -199,6 +199,10 @@ int of_overlay_apply_tree(struct device_node *root, pr_warn("failed to apply %s\n", fragment->name); } + /* We are patching the live tree, reload aliases */ + if (root == of_get_root_node()) + of_alias_scan(); + out_err: of_delete_node(resolved); |