[PATCH v2 15/16] memory: stub out request_barebox_region for PBL
Ahmad Fatoum
a.fatoum at pengutronix.de
Mon Nov 25 07:12:27 PST 2024
To optimize out calls to undefined functions in PBL at compile-time
instead of link time, let's define stubs for the functions that
are referenced in obj-pbl-y files, but inside function sections
that are ultimately unreferenced.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
include/memory.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/memory.h b/include/memory.h
index 571effd3b0d6..8c330e65c012 100644
--- a/include/memory.h
+++ b/include/memory.h
@@ -63,8 +63,18 @@ static inline u64 memory_sdram_size(unsigned int cols,
void register_barebox_area(resource_size_t start, resource_size_t size);
+#if IN_PROPER
struct resource *request_barebox_region(const char *name,
resource_size_t start,
resource_size_t size);
+#else
+static inline struct resource *request_barebox_region(const char *name,
+ resource_size_t start,
+ resource_size_t size)
+{
+
+ return ERR_PTR(-ENOSYS);
+}
+#endif
#endif
--
2.39.5
More information about the barebox
mailing list