[PATCH] cmd: tlv_eeprom: improve mac_read_from_eeprom() log messages

Hugo Villeneuve hugo at hugovil.com
Wed Jun 18 15:25:37 CEST 2025


From: Hugo Villeneuve <hvilleneuve at dimonoff.com>

mac_read_from_eeprom() always display debug infos, and this messes up the
display of the "Net:" section details:

Before:
    Net:   EEPROM: TlvInfo v1 len=172
    eth0: ethernet at 11c20000

After:
    Net:   eth0: ethernet at 11c20000

Fix by moving unconditional "EEPROM: " header into each message and
changing debug message to use log_debug().

Signed-off-by: Hugo Villeneuve <hvilleneuve at dimonoff.com>
---
 cmd/tlv_eeprom.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c
index d7c229e5441..86fee7771a4 100644
--- a/cmd/tlv_eeprom.c
+++ b/cmd/tlv_eeprom.c
@@ -1033,10 +1033,8 @@ int mac_read_from_eeprom(void)
 	struct tlvinfo_header *eeprom_hdr = to_header(eeprom);
 	int devnum = 0; // TODO: support multiple EEPROMs
 
-	puts("EEPROM: ");
-
 	if (read_eeprom(devnum, eeprom)) {
-		printf("Read failed.\n");
+		log_err("EEPROM: read failed\n");
 		return -1;
 	}
 
@@ -1082,8 +1080,8 @@ int mac_read_from_eeprom(void)
 		}
 	}
 
-	printf("%s v%u len=%u\n", eeprom_hdr->signature, eeprom_hdr->version,
-	       be16_to_cpu(eeprom_hdr->totallen));
+	log_debug("EEPROM: %s v%u len=%u\n", eeprom_hdr->signature, eeprom_hdr->version,
+		  be16_to_cpu(eeprom_hdr->totallen));
 
 	return 0;
 }

base-commit: 17012e3068d047ad71460f039eeb0c3be63f82a0
-- 
2.39.5



More information about the U-Boot mailing list