diff options
author | Simon Glass <sjg@chromium.org> | 2020-10-03 18:25:22 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-10-29 23:42:17 +0300 |
commit | a652d9c73a6eea1fdfb901c66178a4d804fac95d (patch) | |
tree | 85eaeea9428ceb50ce9579f87edf49e442447a22 /common | |
parent | 08c3b88dd145d3f7f06e7ad8458905bde7a286ef (diff) | |
download | u-boot-a652d9c73a6eea1fdfb901c66178a4d804fac95d.tar.xz |
dm: Avoid using #ifdef for CONFIG_OF_LIVE
At present this option results in a number of #ifdefs due to the presence
or absence of the global_data of_root member.
Add a few macros to global_data.h to work around this. Update the code
accordingly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/board_r.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/common/board_r.c b/common/board_r.c index b9217b2e27..0829622d0d 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -296,20 +296,21 @@ static int initr_noncached(void) } #endif -#ifdef CONFIG_OF_LIVE static int initr_of_live(void) { - int ret; + if (CONFIG_IS_ENABLED(OF_LIVE)) { + int ret; - bootstage_start(BOOTSTAGE_ID_ACCUM_OF_LIVE, "of_live"); - ret = of_live_build(gd->fdt_blob, (struct device_node **)&gd->of_root); - bootstage_accum(BOOTSTAGE_ID_ACCUM_OF_LIVE); - if (ret) - return ret; + bootstage_start(BOOTSTAGE_ID_ACCUM_OF_LIVE, "of_live"); + ret = of_live_build(gd->fdt_blob, + (struct device_node **)gd_of_root_ptr()); + bootstage_accum(BOOTSTAGE_ID_ACCUM_OF_LIVE); + if (ret) + return ret; + } return 0; } -#endif #ifdef CONFIG_DM static int initr_dm(void) @@ -713,9 +714,7 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_SYS_NONCACHED_MEMORY initr_noncached, #endif -#ifdef CONFIG_OF_LIVE initr_of_live, -#endif #ifdef CONFIG_DM initr_dm, #endif |