summaryrefslogtreecommitdiffstats
path: root/drivers/of/fdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r--drivers/of/fdt.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 7db5353a24c0..84aa9d676375 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -11,6 +11,7 @@
#include <linux/crc32.h>
#include <linux/kernel.h>
#include <linux/initrd.h>
+#include <linux/bootmem.h>
#include <linux/memblock.h>
#include <linux/mutex.h>
#include <linux/of.h>
@@ -1180,14 +1181,6 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
return memblock_reserve(base, size);
}
-/*
- * called from unflatten_device_tree() to bootstrap devicetree itself
- * Architectures can override this definition if memblock isn't used
- */
-void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
-{
- return __va(memblock_alloc(size, align));
-}
#else
void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
{
@@ -1206,13 +1199,12 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
&base, &size, nomap ? " (nomap)" : "");
return -ENOSYS;
}
+#endif
-void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align)
+static void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
{
- WARN_ON(1);
- return NULL;
+ return memblock_virt_alloc(size, align);
}
-#endif
bool __init early_init_dt_verify(void *params)
{