From dedef8f6f9fa97c8d0639cbd6aae51b5c2d3c803 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Thu, 12 Jun 2025 10:04:10 -0400 Subject: cmd: tlv_eeprom: fix typo errors in comments and error msg Fix typo errors in comments and error message by replacing EERPOM->EEPROM. Signed-off-by: Hugo Villeneuve Reviewed-by: Quentin Schulz --- cmd/tlv_eeprom.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c index d7c229e5441..89546cef16f 100644 --- a/cmd/tlv_eeprom.c +++ b/cmd/tlv_eeprom.c @@ -41,7 +41,7 @@ static int set_date(char *buf, const char *string); static int set_bytes(char *buf, const char *string, int *converted_accum); static void show_tlv_devices(int current_dev); -/* The EERPOM contents after being read into memory */ +/* The EEPROM contents after being read into memory */ static u8 eeprom[TLV_INFO_MAX_LEN]; static struct udevice *tlv_devices[MAX_TLV_DEVICES]; @@ -430,7 +430,7 @@ int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) static int has_been_read; int ret; - // If no arguments, read the EERPOM and display its contents + // If no arguments, read the EEPROM and display its contents if (argc == 1) { if (!has_been_read) { ret = read_eeprom(current_dev, eeprom); @@ -560,7 +560,7 @@ U_BOOT_CMD(tlv_eeprom, 4, 1, do_tlv_eeprom, /** * tlvinfo_find_tlv * - * This function finds the TLV with the supplied code in the EERPOM. + * This function finds the TLV with the supplied code in the EEPROM. * An offset from the beginning of the EEPROM is returned in the * eeprom_index parameter if the TLV is found. */ @@ -631,7 +631,7 @@ static bool tlvinfo_add_tlv(u8 *eeprom, int tcode, char *strval) char data[MAX_TLV_VALUE_LEN]; int eeprom_index; - // Encode each TLV type into the format to be stored in the EERPOM + // Encode each TLV type into the format to be stored in the EEPROM switch (tcode) { case TLV_CODE_PRODUCT_NAME: case TLV_CODE_PART_NUMBER: @@ -691,7 +691,7 @@ static bool tlvinfo_add_tlv(u8 *eeprom, int tcode, char *strval) // Is there room for this TLV? if ((be16_to_cpu(eeprom_hdr->totallen) + ENT_SIZE + new_tlv_len) > TLV_TOTAL_LEN_MAX) { - printf("ERROR: There is not enough room in the EERPOM to save data.\n"); + printf("ERROR: There is not enough room in the EEPROM to save data.\n"); return false; } -- cgit v1.2.3 From ee6d8ba15ea6a249ca59d97f3d645db4428ce11e Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Wed, 18 Jun 2025 09:25:37 -0400 Subject: cmd: tlv_eeprom: improve mac_read_from_eeprom() log messages 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@11c20000 After: Net: eth0: ethernet@11c20000 Fix by moving unconditional "EEPROM: " header into each message and changing debug message to use log_debug(). Signed-off-by: Hugo Villeneuve --- cmd/tlv_eeprom.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'cmd') diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c index 89546cef16f..3127660dd9e 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; } -- cgit v1.2.3