]> git.baikalelectronics.ru Git - uboot.git/commitdiff
env: add failing trace in env_erase
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 14 Dec 2022 15:51:32 +0000 (16:51 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 11 Jan 2023 20:02:24 +0000 (15:02 -0500)
Add trace in env save to indicate any errors to end user and avoid
silent output when the command 'env erase' is not executed as it is
done in env_save with commit fa9387012b1e ("env: add failing trace in
env_save")

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
env/env.c

index 69848fb060807e928990cc600082cb04ff291a18..06078c7f3744178524211ae46873ffcf311a3b42 100644 (file)
--- a/env/env.c
+++ b/env/env.c
@@ -311,11 +311,15 @@ int env_erase(void)
        if (drv) {
                int ret;
 
-               if (!drv->erase)
+               if (!drv->erase) {
+                       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("Erasing Environment on %s... ", drv->name);
                ret = drv->erase();