colibri_imx6: fix video stdout in default environment
[oweals/u-boot.git] / env / onenand.c
index 2e3045c5f5de69b9de5acaa60eb58df1c8f435af..dfd4e939f8f89d816b1e9410080f811f9b0139d9 100644 (file)
@@ -1,16 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2010 DENX Software Engineering
  * Wolfgang Denk <wd@denx.de>
  *
  * (C) Copyright 2005-2009 Samsung Electronics
  * Kyungmin Park <kyungmin.park@samsung.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <command.h>
-#include <environment.h>
+#include <env_internal.h>
 #include <linux/stddef.h>
 #include <malloc.h>
 #include <search.h>
@@ -57,10 +56,10 @@ static int env_onenand_load(void)
 #endif /* !ENV_IS_EMBEDDED */
 
        rc = env_import(buf, 1);
-       if (rc)
+       if (!rc)
                gd->env_valid = ENV_VALID;
 
-       return rc ? 0 : -EIO;
+       return rc;
 }
 
 static int env_onenand_save(void)