| From c1ac3852d55e4434fd68fbe1b28a6c181114e532 Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Thu, 4 Jan 2018 10:08:36 +0100 |
| Subject: [PATCH 0935/1795] of/fdt: Fix #ifdef dependency of early flattree |
| declarations |
| |
| If OF_FLATTREE=y, but OF_EARLY_FLATTREE=n: |
| |
| drivers/tty/serial/earlycon.o: In function `param_setup_earlycon': |
| earlycon.c:(.init.text+0x3a4): undefined reference to `early_init_dt_scan_chosen_stdout' |
| |
| Fix this by moving the early flattree forward declarations and dummy |
| implementations inside an #ifdef CONFIG_OF_EARLY_FLATTREE block. |
| |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| Signed-off-by: Rob Herring <robh@kernel.org> |
| (cherry picked from commit f347c36701339d55de15e01a3d392c0c3cd289f5) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| include/linux/of_fdt.h | 12 ++++++++---- |
| 1 file changed, 8 insertions(+), 4 deletions(-) |
| |
| diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h |
| index f3d34619bd26..02c05028d0ba 100644 |
| --- a/include/linux/of_fdt.h |
| +++ b/include/linux/of_fdt.h |
| @@ -47,6 +47,12 @@ extern void *initial_boot_params; |
| extern char __dtb_start[]; |
| extern char __dtb_end[]; |
| |
| +/* Other Prototypes */ |
| +extern u64 of_flat_dt_translate_address(unsigned long node); |
| +extern void of_fdt_limit_memory(int limit); |
| +#endif /* CONFIG_OF_FLATTREE */ |
| + |
| +#ifdef CONFIG_OF_EARLY_FLATTREE |
| /* For scanning the flat device-tree at boot time */ |
| extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, |
| int depth, void *data), |
| @@ -96,16 +102,14 @@ extern void unflatten_device_tree(void); |
| extern void unflatten_and_copy_device_tree(void); |
| extern void early_init_devtree(void *); |
| extern void early_get_first_memblock_info(void *, phys_addr_t *); |
| -extern u64 of_flat_dt_translate_address(unsigned long node); |
| -extern void of_fdt_limit_memory(int limit); |
| -#else /* CONFIG_OF_FLATTREE */ |
| +#else /* CONFIG_OF_EARLY_FLATTREE */ |
| static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; } |
| static inline void early_init_fdt_scan_reserved_mem(void) {} |
| static inline void early_init_fdt_reserve_self(void) {} |
| static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } |
| static inline void unflatten_device_tree(void) {} |
| static inline void unflatten_and_copy_device_tree(void) {} |
| -#endif /* CONFIG_OF_FLATTREE */ |
| +#endif /* CONFIG_OF_EARLY_FLATTREE */ |
| |
| #endif /* __ASSEMBLY__ */ |
| #endif /* _LINUX_OF_FDT_H */ |
| -- |
| 2.19.0 |
| |