diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2018-01-04 04:08:36 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-01-05 14:04:30 -0500 |
commit | f347c36701339d55de15e01a3d392c0c3cd289f5 (patch) | |
tree | 6efd5d00f27c36ecccd2c881ce9f437a15f8ac88 | |
parent | 33314a1387009361e6cfcfaa772abe3b90d11321 (diff) |
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>
-rw-r--r-- | include/linux/of_fdt.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 013c5418aeec..444e6e283828 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
@@ -47,6 +47,12 @@ extern void *initial_boot_params; | |||
47 | extern char __dtb_start[]; | 47 | extern char __dtb_start[]; |
48 | extern char __dtb_end[]; | 48 | extern char __dtb_end[]; |
49 | 49 | ||
50 | /* Other Prototypes */ | ||
51 | extern u64 of_flat_dt_translate_address(unsigned long node); | ||
52 | extern void of_fdt_limit_memory(int limit); | ||
53 | #endif /* CONFIG_OF_FLATTREE */ | ||
54 | |||
55 | #ifdef CONFIG_OF_EARLY_FLATTREE | ||
50 | /* For scanning the flat device-tree at boot time */ | 56 | /* For scanning the flat device-tree at boot time */ |
51 | extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, | 57 | extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, |
52 | int depth, void *data), | 58 | int depth, void *data), |
@@ -97,16 +103,14 @@ extern void unflatten_device_tree(void); | |||
97 | extern void unflatten_and_copy_device_tree(void); | 103 | extern void unflatten_and_copy_device_tree(void); |
98 | extern void early_init_devtree(void *); | 104 | extern void early_init_devtree(void *); |
99 | extern void early_get_first_memblock_info(void *, phys_addr_t *); | 105 | extern void early_get_first_memblock_info(void *, phys_addr_t *); |
100 | extern u64 of_flat_dt_translate_address(unsigned long node); | 106 | #else /* CONFIG_OF_EARLY_FLATTREE */ |
101 | extern void of_fdt_limit_memory(int limit); | ||
102 | #else /* CONFIG_OF_FLATTREE */ | ||
103 | static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; } | 107 | static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; } |
104 | static inline void early_init_fdt_scan_reserved_mem(void) {} | 108 | static inline void early_init_fdt_scan_reserved_mem(void) {} |
105 | static inline void early_init_fdt_reserve_self(void) {} | 109 | static inline void early_init_fdt_reserve_self(void) {} |
106 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } | 110 | static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } |
107 | static inline void unflatten_device_tree(void) {} | 111 | static inline void unflatten_device_tree(void) {} |
108 | static inline void unflatten_and_copy_device_tree(void) {} | 112 | static inline void unflatten_and_copy_device_tree(void) {} |
109 | #endif /* CONFIG_OF_FLATTREE */ | 113 | #endif /* CONFIG_OF_EARLY_FLATTREE */ |
110 | 114 | ||
111 | #endif /* __ASSEMBLY__ */ | 115 | #endif /* __ASSEMBLY__ */ |
112 | #endif /* _LINUX_OF_FDT_H */ | 116 | #endif /* _LINUX_OF_FDT_H */ |