diff mbox series

[3/4] xilinx: common: Check return value from variable setup

Message ID 97d5f6f7a74f8fc409dbff8395110746dbc4d096.1597228970.git.michal.simek@xilinx.com
State Accepted
Commit ca0f616530316f324516fd91a2d90e0449f1e526
Delegated to: Michal Simek
Headers show
Series xilinx: common: Fix fdt/initrd_high and bootm_* variables | expand

Commit Message

Michal Simek Aug. 12, 2020, 10:42 a.m. UTC
env_set..() can failed that's why check return status and report it back to
make sure that user is aware that's something went wrong.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Change type to u32 to have defined bit operations (mentioned by Marek)
Origin patch sent as https://lists.denx.de/pipermail/u-boot/2020-August/422508.html
---
 board/xilinx/common/board.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 901591ba2a85..581c88ad49a4 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -77,10 +77,15 @@  void *board_fdt_blob_setup(void)
 
 int board_late_init_xilinx(void)
 {
-	env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
+	u32 ret = 0;
 
-	env_set_addr("bootm_low", (void *)gd->ram_base);
-	env_set_addr("bootm_size", (void *)gd->ram_size);
+	ret |= env_set_hex("script_offset_f", CONFIG_BOOT_SCRIPT_OFFSET);
+
+	ret |= env_set_addr("bootm_low", (void *)gd->ram_base);
+	ret |= env_set_addr("bootm_size", (void *)gd->ram_size);
+
+	if (ret)
+		printf("%s: Saving run time variables FAILED\n", __func__);
 
 	return 0;
 }