diff options
author | Grant Likely <grant.likely@linaro.org> | 2013-08-28 16:18:32 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-08-28 16:18:32 -0400 |
commit | a1727da599ad030ccaf4073473fd235c8ee28219 (patch) | |
tree | 8e3cd21c4657e725a922fe2ee0da8bd8dfdb6b1c /drivers/of/fdt.c | |
parent | 7e0bdf15cee7d2c809558b8169dc5b08792d0c82 (diff) |
of: consolidate definition of early_init_dt_alloc_memory_arch()
Most architectures use the same implementation. Collapse the common ones
into a single weak function that can be overridden.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of/fdt.c')
-rw-r--r-- | drivers/of/fdt.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index b9657e5304ed..d49b3e8159bb 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/initrd.h> | 13 | #include <linux/initrd.h> |
14 | #include <linux/memblock.h> | ||
14 | #include <linux/module.h> | 15 | #include <linux/module.h> |
15 | #include <linux/of.h> | 16 | #include <linux/of.h> |
16 | #include <linux/of_fdt.h> | 17 | #include <linux/of_fdt.h> |
@@ -700,6 +701,17 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, | |||
700 | return 1; | 701 | return 1; |
701 | } | 702 | } |
702 | 703 | ||
704 | #ifdef CONFIG_HAVE_MEMBLOCK | ||
705 | /* | ||
706 | * called from unflatten_device_tree() to bootstrap devicetree itself | ||
707 | * Architectures can override this definition if memblock isn't used | ||
708 | */ | ||
709 | void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align) | ||
710 | { | ||
711 | return __va(memblock_alloc(size, align)); | ||
712 | } | ||
713 | #endif | ||
714 | |||
703 | /** | 715 | /** |
704 | * unflatten_device_tree - create tree of device_nodes from flat blob | 716 | * unflatten_device_tree - create tree of device_nodes from flat blob |
705 | * | 717 | * |