Skip to contentSkip to conversation

env: add failing trace in env_save

PATCH New Patrick Delaunay 2 participants 2 messages Jun 24, 2020 – Jul 27, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env: add failing trace in env_save

Add trace in env save to indicate any errors to end user and avoid silent output when the command 'env save' is not executed.

---

 env/env.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
env/env.c +7 -3
index dcc25c030b..7719bc3620 100644
@@ -240,13 +240,17 @@ int env_save(void)
 	if (drv) {
 		int ret;
 
-		if (!drv->save)
+		printf("Saving Environment to %s... ", drv->name);
+		if (!drv->save) {
+			printf("not possible\n");
 			return -ENODEV;
+		}
 
-		if (!env_has_inited(drv->location))
+		if (!env_has_inited(drv->location)) {
+			printf("not initialized\n");
 			return -ENODEV;
+		}
 
-		printf("Saving Environment to %s... ", drv->name);
 		ret = drv->save();
 		if (ret)
 			printf("Failed (%d)\n", ret);
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 env: add failing trace in env_save

Quoted 4 lines · Patrick Delaunay

Add trace in env save to indicate any errors to end user and avoid silent output when the command 'env save' is not executed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200727/9b1b257a/attachment.sig>