[PATCH master] of: define of_read_file/barebox_register_of when !CONFIG_OFTREE

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Jun 16 03:20:31 PDT 2023

barebox may be built as x86 EFI payload with CONFIG_OFTREE=n. This
recently started to fail, because of newly added symbols that had
no stubs defined.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
 include/of.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/include/of.h b/include/of.h
index 0037bad6c4d7..92a15f5c4a13 100644
--- a/include/of.h
+++ b/include/of.h
@@ -6,6 +6,7 @@
 #include <errno.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/err.h>
 #include <asm/byteorder.h>
 /* Default string compare functions */
@@ -116,7 +117,6 @@ int of_diff(struct device_node *a, struct device_node *b, int indent);
 int of_probe(void);
 int of_parse_dtb(struct fdt_header *fdt);
 struct device_node *of_unflatten_dtb(const void *fdt, int size);
-struct device_node *of_read_file(const char *filename);
 struct device_node *of_unflatten_dtb_const(const void *infdt, int size);
 int of_fixup_reserved_memory(struct device_node *node, void *data);
@@ -124,6 +124,7 @@ int of_fixup_reserved_memory(struct device_node *node, void *data);
 struct cdev;
+extern struct device_node *of_read_file(const char *filename);
 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);
@@ -361,6 +362,11 @@ static inline const char *of_node_full_name(const struct device_node *np)
+static inline struct device_node *of_read_file(const char *filename)
+	return ERR_PTR(-ENOSYS);
 static inline struct of_reserve_map *of_get_reserve_map(void)
 	return NULL;
@@ -429,6 +435,11 @@ static inline int of_set_root_node(struct device_node *node)
 	return -ENOSYS;
+static inline int barebox_register_of(struct device_node *root)
+	return -ENOSYS;
 static inline struct device *of_platform_device_create(struct device_node *np,
 							 struct device *parent)

More information about the barebox mailing list