Skip to contentSkip to conversation

cmd: tlv_eeprom: return after successful read from EEPROM

PATCH In review Martin Schiller 2 participants 3 messages Apr 16, 2025 – May 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: tlv_eeprom: return after successful read from EEPROM

Commit f6eff35b8c19 ("cmd: tlv_eeprom: handle -ENODEV error from read_eeprom function") removed the needed 'return 0' after a successful read. As a result, the usage message is shown when 'tlv_eeprom read' is successfully called.

Let's fix it by adding the needed 'return 0'.

---
 cmd/tlv_eeprom.c | 1 +
 1 file changed, 1 insertion(+)
cmd/tlv_eeprom.c +1 -0
index 0aec7521770..d7c229e5441 100644
@@ -476,6 +476,7 @@ int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
 		printf("EEPROM data loaded from device to memory.\n");
 		has_been_read = 1;
+		return 0;
 	}
 
 	// Subsequent commands require that the EEPROM has already been read.
Signature · 1 line
2.39.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Martin Schiller

Commit f6eff35b8c19 ("cmd: tlv_eeprom: handle -ENODEV error from read_eeprom function") removed the needed 'return 0' after a successful read. As a result, the usage message is shown when 'tlv_eeprom read' is successfully called.

Let's fix it by adding the needed 'return 0'.

Thanks,
Stefan

Quoted 9 lines
---
  cmd/tlv_eeprom.c | 1 +
  1 file changed, 1 insertion(+)
cmd/tlv_eeprom.c +0 -0
index 0aec7521770..d7c229e5441 100644

cmd/tlv_eeprom.c int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) · line 482

Quoted 7 lines
cmd/tlv_eeprom.c +1 -0
@@ -476,6 +476,7 @@ int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
  		printf("EEPROM data loaded from device to memory.\n");
  		has_been_read = 1;
+		return 0;
  	}
 
  	// Subsequent commands require that the EEPROM has already been read.

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#2 lore raw
In reply to Martin Schiller
Quoted 8 lines · Martin Schiller

Commit f6eff35b8c19 ("cmd: tlv_eeprom: handle -ENODEV error from read_eeprom function") removed the needed 'return 0' after a successful read. As a result, the usage message is shown when 'tlv_eeprom read' is successfully called.

Let's fix it by adding the needed 'return 0'.

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 9 lines
---
  cmd/tlv_eeprom.c | 1 +
  1 file changed, 1 insertion(+)
cmd/tlv_eeprom.c +0 -0
index 0aec7521770..d7c229e5441 100644

cmd/tlv_eeprom.c int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) · line 482

Quoted 7 lines
cmd/tlv_eeprom.c +1 -0
@@ -476,6 +476,7 @@ int do_tlv_eeprom(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
  		printf("EEPROM data loaded from device to memory.\n");
  		has_been_read = 1;
+		return 0;
  	}
 
  	// Subsequent commands require that the EEPROM has already been read.

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]