[PATCH v2025.09.y 26/58] common: tlv: fix link error when CONFIG_NET is disabled

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Mar 13 06:25:10 PDT 2026


ethaddr_list and eth_of_get_fixup_node are used unconditionally in
of_tlv_fixup, but there is no dependency on CONFIG_NET for CONFIG_TLV.

Turn the ethernet-related fixup code into dead code if CONFIG_NET is
disabled and emit a warning to fix this.

(cherry picked from commit 53c72e610a314fc4a9a133e2615f0bc88af9df28)

Reported-by: 9l at 9lo.re
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
Link: https://lore.barebox.org/20260205153540.2900244-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/tlv/parser.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/tlv/parser.c b/common/tlv/parser.c
index fc46092650b1..59d4c724f151 100644
--- a/common/tlv/parser.c
+++ b/common/tlv/parser.c
@@ -93,6 +93,11 @@ int of_tlv_fixup(struct device_node *root, void *ctx)
 	if (!ethaddrs)
 		return 0;
 
+	if (!IS_ENABLED(CONFIG_NET)) {
+		pr_warn("CONFIG_NET disabled, so skipping ethernet-address trimming in fixup\n");
+		return 0;
+	}
+
 	list_for_each_entry(addr, &ethaddr_list, list) {
 		char propname[sizeof("address-4294967295")];
 		const char *enetaddr_tlv_str;
-- 
2.47.3




More information about the barebox mailing list