mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master] of: define of_read_file/barebox_register_of when !CONFIG_OFTREE
@ 2023-06-16 10:20 Ahmad Fatoum
  2023-06-16 10:22 ` Ahmad Fatoum
  2023-06-21  8:47 ` Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2023-06-16 10:20 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@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;
 
 #ifdef CONFIG_OFTREE
+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)
 }
 
 #else
+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)
 {
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-21  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-16 10:20 [PATCH master] of: define of_read_file/barebox_register_of when !CONFIG_OFTREE Ahmad Fatoum
2023-06-16 10:22 ` Ahmad Fatoum
2023-06-21  8:47 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox