doc: Add top-level description about U-Boot documentation
[oweals/u-boot.git] / env / onenand.c
index 319f553262db4945ef19ccc7642b0a82bbdbd75f..d371bd757cb5c24036ace1a0b789d130034d9354 100644 (file)
@@ -1,11 +1,10 @@
+// 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>
@@ -26,7 +25,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static void env_onenand_load(void)
+static int env_onenand_load(void)
 {
        struct mtd_info *mtd = &onenand_mtd;
 #ifdef CONFIG_ENV_ADDR_FLEX
@@ -57,8 +56,10 @@ static void env_onenand_load(void)
 #endif /* !ENV_IS_EMBEDDED */
 
        rc = env_import(buf, 1);
-       if (rc)
+       if (!rc)
                gd->env_valid = ENV_VALID;
+
+       return rc;
 }
 
 static int env_onenand_save(void)