summaryrefslogtreecommitdiff
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2021-08-11 10:51:03 +0200
committerRob Herring <robh@kernel.org>2021-08-24 17:09:01 -0500
commitbf2e8609734bd773610d414b72eb1cfe09b4c24d (patch)
tree082e825d7cb3ea8f74466db06f2ac0cc989cf329 /drivers/of/fdt.c
parent2af2b50acf9b9c38080a45f32a9c162e2a0f2de2 (diff)
of: fdt: Use IS_ENABLED(CONFIG_BLK_DEV_INITRD) instead of #ifdef
Replace the conditional compilation using "#ifdef CONFIG_BLK_DEV_INITRD" by a check for "IS_ENABLED(CONFIG_BLK_DEV_INITRD)", to increase compile coverage and to simplify the code. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/604c13747f09d800da6a7c12f661e1ec146f1dfd.1628670468.git.geert+renesas@glider.be
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 6c0cdee03deb..a26199022d2f 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -896,7 +896,6 @@ const void * __init of_flat_dt_match_machine(const void *default_match,
return best_data;
}
-#ifdef CONFIG_BLK_DEV_INITRD
static void __early_init_dt_declare_initrd(unsigned long start,
unsigned long end)
{
@@ -922,6 +921,9 @@ static void __init early_init_dt_check_for_initrd(unsigned long node)
int len;
const __be32 *prop;
+ if (!IS_ENABLED(CONFIG_BLK_DEV_INITRD))
+ return;
+
pr_debug("Looking for initrd properties... ");
prop = of_get_flat_dt_prop(node, "linux,initrd-start", &len);
@@ -940,11 +942,6 @@ static void __init early_init_dt_check_for_initrd(unsigned long node)
pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", start, end);
}
-#else
-static inline void early_init_dt_check_for_initrd(unsigned long node)
-{
-}
-#endif /* CONFIG_BLK_DEV_INITRD */
/**
* early_init_dt_check_for_elfcorehdr - Decode elfcorehdr location from flat