diff options
author | Simon Glass | 2020-10-03 09:25:22 -0600 |
---|---|---|
committer | Simon Glass | 2020-10-29 14:42:17 -0600 |
commit | a652d9c73a6eea1fdfb901c66178a4d804fac95d (patch) | |
tree | 85eaeea9428ceb50ce9579f87edf49e442447a22 /include/dm | |
parent | 08c3b88dd145d3f7f06e7ad8458905bde7a286ef (diff) |
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 'include/dm')
-rw-r--r-- | include/dm/of.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/include/dm/of.h b/include/dm/of.h index 6bef73b441c..5cb6f44a6c6 100644 --- a/include/dm/of.h +++ b/include/dm/of.h @@ -90,17 +90,10 @@ DECLARE_GLOBAL_DATA_PTR; * * @returns true if livetree is active, false it not */ -#ifdef CONFIG_OF_LIVE static inline bool of_live_active(void) { - return gd->of_root != NULL; + return gd_of_root() != NULL; } -#else -static inline bool of_live_active(void) -{ - return false; -} -#endif #define OF_BAD_ADDR ((u64)-1) |