aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-03 11:31:37 -0600
committerSimon Glass <sjg@chromium.org>2020-10-29 14:42:18 -0600
commit9e948b9b99d17ea6c2204a1b6251a5c33ee83dd9 (patch)
tree191636f43861aa9bcc8ecb13be7cf29401d6a9ab /drivers
parentfbe27a54ebbe7433bbccf242f4edda61e2c1ba3e (diff)
downloadu-boot-9e948b9b99d17ea6c2204a1b6251a5c33ee83dd9.zip
u-boot-9e948b9b99d17ea6c2204a1b6251a5c33ee83dd9.tar.gz
u-boot-9e948b9b99d17ea6c2204a1b6251a5c33ee83dd9.tar.bz2
dm: core: Convert #ifdef to if() in root.c
Convert a few conditions to use compile-time checks to reduce the number of build paths. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/root.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index e8df5ae..5f10d7a 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -50,7 +50,6 @@ void dm_fixup_for_gd_move(struct global_data *new_gd)
}
}
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
void fix_drivers(void)
{
struct driver *drv =
@@ -129,8 +128,6 @@ void fix_devices(void)
}
}
-#endif
-
int dm_init(bool of_live)
{
int ret;
@@ -141,11 +138,11 @@ int dm_init(bool of_live)
}
INIT_LIST_HEAD(&DM_UCLASS_ROOT_NON_CONST);
-#if defined(CONFIG_NEEDS_MANUAL_RELOC)
- fix_drivers();
- fix_uclass();
- fix_devices();
-#endif
+ if (IS_ENABLED(CONFIG_NEEDS_MANUAL_RELOC)) {
+ fix_drivers();
+ fix_uclass();
+ fix_devices();
+ }
ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
if (ret)
@@ -350,9 +347,8 @@ int dm_init_and_scan(bool pre_reloc_only)
{
int ret;
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
- dm_populate_phandle_data();
-#endif
+ if (CONFIG_IS_ENABLED(OF_PLATDATA))
+ dm_populate_phandle_data();
ret = dm_init(CONFIG_IS_ENABLED(OF_LIVE));
if (ret) {