Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[platform/kernel/u-boot.git] / env / ubi.c
index 72c7a78..eb2346f 100644 (file)
--- a/env/ubi.c
+++ b/env/ubi.c
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (c) Copyright 2012 by National Instruments,
  *        Joe Hershberger <joe.hershberger@ni.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -115,7 +114,7 @@ static int env_ubi_load(void)
        if (ubi_part(CONFIG_ENV_UBI_PART, NULL)) {
                printf("\n** Cannot find mtd partition \"%s\"\n",
                       CONFIG_ENV_UBI_PART);
-               set_default_env(NULL);
+               set_default_env(NULL, 0);
                return -EIO;
        }
 
@@ -152,20 +151,18 @@ static int env_ubi_load(void)
        if (ubi_part(CONFIG_ENV_UBI_PART, NULL)) {
                printf("\n** Cannot find mtd partition \"%s\"\n",
                       CONFIG_ENV_UBI_PART);
-               set_default_env(NULL);
+               set_default_env(NULL, 0);
                return -EIO;
        }
 
        if (ubi_volume_read(CONFIG_ENV_UBI_VOLUME, buf, CONFIG_ENV_SIZE)) {
                printf("\n** Unable to read env from %s:%s **\n",
                       CONFIG_ENV_UBI_PART, CONFIG_ENV_UBI_VOLUME);
-               set_default_env(NULL);
+               set_default_env(NULL, 0);
                return -EIO;
        }
 
-       env_import(buf, 1);
-
-       return 0;
+       return env_import(buf, 1);
 }
 #endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */