[PATCH 3/4] of: add of_get_reserve_map stub for !CONFIG_OFTREE

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Jun 8 22:43:41 PDT 2022

From: Rouven Czerwinski <r.czerwinski at pengutronix.de>

This allows us to unconditionally include of.h in files which did not
require CONFIG_OFTREE, required for the MMU code in later patches.

Signed-off-by: Rouven Czerwinski <r.czerwinski at pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
Compared with Rouven's v2, give extern declaration an extern
in front like functions around it. Move static inline stub
to top of #else for symmetry.
 include/of.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/of.h b/include/of.h
index 0d125d8256d6..d55016f1e372 100644
--- a/include/of.h
+++ b/include/of.h
@@ -62,7 +62,6 @@ struct of_reserve_map {
 int of_add_reserve_entry(resource_size_t start, resource_size_t end,
 		 int flags);
-struct of_reserve_map *of_get_reserve_map(void);
 void of_clean_reserve_map(void);
 void fdt_add_reserve_map(void *fdt);
@@ -120,6 +119,7 @@ struct device_node *of_unflatten_dtb_const(const void *infdt, int size);
 struct cdev;
+extern struct of_reserve_map *of_get_reserve_map(void);
 extern int of_bus_n_addr_cells(struct device_node *np);
 extern int of_n_addr_cells(struct device_node *np);
 extern int of_bus_n_size_cells(struct device_node *np);
@@ -322,6 +322,11 @@ int of_autoenable_device_by_path(char *path);
 int of_autoenable_i2c_by_component(char *path);
 int of_prepend_machine_compatible(struct device_node *root, const char *compat);
+static inline struct of_reserve_map *of_get_reserve_map(void)
+	return NULL;
 static inline bool of_node_name_eq(const struct device_node *np, const char *name)
 	return false;

More information about the barebox mailing list