public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] env: add failing trace in env_save
@ 2020-06-24  8:17 Patrick Delaunay
  2020-07-27 13:32 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Delaunay @ 2020-06-24  8:17 UTC (permalink / raw)
  To: u-boot

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(-)

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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] env: add failing trace in env_save
  2020-06-24  8:17 [PATCH] env: add failing trace in env_save Patrick Delaunay
@ 2020-07-27 13:32 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2020-07-27 13:32 UTC (permalink / raw)
  To: u-boot

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!

-- 
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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-27 13:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-24  8:17 [PATCH] env: add failing trace in env_save Patrick Delaunay
2020-07-27 13:32 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox