From 3b1a2c97210b1edd1a999ff8c1f72ab28f7609f7 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Wed, 13 May 2015 16:33:56 +0200 Subject: of/fdt: Make fdt blob input parameters of unflatten functions const Operations to unflatten fdt blobs never modify the input blobs, hence make them const. Now we no longer need to cast arbitrary const data to "void *" when calling of_fdt_unflatten_tree(). Signed-off-by: Geert Uytterhoeven Signed-off-by: Rob Herring --- drivers/of/fdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/of/fdt.c') diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index cde35c5d0191..9628c4a77f76 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -168,7 +168,7 @@ static void *unflatten_dt_alloc(void **mem, unsigned long size, * @dad: Parent struct device_node * @fpsize: Size of the node path up at the current depth. */ -static void * unflatten_dt_node(void *blob, +static void * unflatten_dt_node(const void *blob, void *mem, int *poffset, struct device_node *dad, @@ -378,7 +378,7 @@ static void * unflatten_dt_node(void *blob, * @dt_alloc: An allocator that provides a virtual address to memory * for the resulting tree */ -static void __unflatten_device_tree(void *blob, +static void __unflatten_device_tree(const void *blob, struct device_node **mynodes, void * (*dt_alloc)(u64 size, u64 align)) { @@ -441,7 +441,7 @@ static void *kernel_tree_alloc(u64 size, u64 align) * pointers of the nodes so the normal device-tree walking functions * can be used. */ -void of_fdt_unflatten_tree(unsigned long *blob, +void of_fdt_unflatten_tree(const unsigned long *blob, struct device_node **mynodes) { __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc); -- cgit v1.2.3 From aefc7ec27c318faa58e7e92dbe85217b2bab7a0e Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Thu, 18 Jun 2015 20:35:46 -0500 Subject: dt/fdt: add empty versions of early_init_dt_*_memory_arch With the addition of commit 0166dc1 (of: make CONFIG_OF user selectable), architectures which don't enable memblock and don't have their own early_init_dt_*_memory_arch implementations will break when CONFIG_OF is enabled. Really, we should have better separation of CONFIG_OF and CONFIG_OF_EARLY_FLATTREE, but doing that will require quite a bit of shuffling of architecture code. That will have to wait for another day. Signed-off-by: Rob Herring Cc: Grant Likely --- drivers/of/fdt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/of/fdt.c') diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 9628c4a77f76..0e314ba1f985 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1015,6 +1015,11 @@ 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) +{ + WARN_ON(1); +} + int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size, bool nomap) { @@ -1022,6 +1027,12 @@ int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, &base, &size, nomap ? " (nomap)" : ""); return -ENOSYS; } + +void * __init __weak early_init_dt_alloc_memory_arch(u64 size, u64 align) +{ + WARN_ON(1); + return NULL; +} #endif bool __init early_init_dt_verify(void *params) -- cgit v1.2.3