mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master] of: define of_read_file/barebox_register_of when !CONFIG_OFTREE
Date: Fri, 16 Jun 2023 12:20:31 +0200	[thread overview]
Message-ID: <20230616102031.1556138-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2023-06-16 10:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 10:20 Ahmad Fatoum [this message]
2023-06-16 10:22 ` Ahmad Fatoum
2023-06-21  8:47 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230616102031.1556138-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox