[PATCH] common: tlv: fix link error when CONFIG_NET is disabled

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Feb 5 07:35:39 PST 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.

Reported-by: 9l at 9lo.re
Signed-off-by: Ahmad Fatoum <a.fatoum 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 7e1514758271..010e4cce38b0 100644
--- a/common/tlv/parser.c
+++ b/common/tlv/parser.c
@@ -187,6 +187,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