diff mbox series

env: add failing trace in env_save

Message ID 20200624081751.2220-1-patrick.delaunay@st.com
State Accepted
Commit 8968288cb477ba69b002db01a6407cf78e3a6e06
Delegated to: Tom Rini
Headers show
Series env: add failing trace in env_save | expand

Commit Message

Patrick DELAUNAY June 24, 2020, 8:17 a.m. UTC
Add trace in env save to indicate any errors to end user and avoid
silent output when the command 'env save' is not executed.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---

 env/env.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Tom Rini July 27, 2020, 1:32 p.m. UTC | #1
On Wed, Jun 24, 2020 at 10:17:50AM +0200, Patrick Delaunay wrote:

> Add trace in env save to indicate any errors to end user and avoid
> silent output when the command 'env save' is not executed.
> 
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/env/env.c b/env/env.c
index dcc25c030b..7719bc3620 100644
--- a/env/env.c
+++ b/env/env.c
@@ -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);