Skip to contentSkip to conversation

cmd: adc: Report return value on error

PATCH In review Samuel Dionne-Riel 2 participants 2 messages Dec 20, 2021 – Jan 15, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: adc: Report return value on error

Reporting the return value should always be done on error conditions, this way the developer can start debugging issues with more knowledge in-hand.

---
 cmd/adc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cmd/adc.c +2 -2
index 16f914a030..75739bc8ee 100644
@@ -81,8 +81,8 @@ static int do_adc_single(struct cmd_tbl *cmdtp, int flag, int argc,
 	ret = adc_channel_single_shot(argv[1], simple_strtol(argv[2], NULL, 0),
 				      &data);
 	if (ret) {
-		printf("Error getting single shot for device %s channel %s\n",
-		       argv[1], argv[2]);
+		printf("Error getting single shot for device %s channel %s (ret=%d)\n",
+		       argv[1], argv[2], ret);
 		return CMD_RET_FAILURE;
 	}
 
Signature · 6 lines
2.34.0



-- 
Samuel Dionne-Riel
#1 lore raw
Quoted 5 lines · Samuel Dionne-Riel

Reporting the return value should always be done on error conditions, this way the developer can start debugging issues with more knowledge in-hand.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom