From d6242edcce52499ee24a1994272ecba63fe96e17 Mon Sep 17 00:00:00 2001 From: T Karthik Reddy Date: Tue, 22 Sep 2020 05:18:53 -0600 Subject: [PATCH] microblaze: board: Check return value whlie saving env variables Check and print warning if run time env variables are not saved. Signed-off-by: T Karthik Reddy Signed-off-by: Michal Simek --- board/xilinx/microblaze-generic/microblaze-generic.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 4e569e910d..724c33987b 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -37,6 +37,7 @@ int dram_init(void) int board_late_init(void) { ulong max_size, lowmem_size; + u32 status = 0; #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SYSRESET_MICROBLAZE) int ret; @@ -58,9 +59,12 @@ int board_late_init(void) /* Linux default LOWMEM_SIZE is 0x30000000 = 768MB */ lowmem_size = gd->ram_base + 768 * 1024 * 1024; - env_set_addr("initrd_high", (void *)min_t(ulong, max_size, - lowmem_size)); - env_set_addr("fdt_high", (void *)min_t(ulong, max_size, lowmem_size)); + status |= env_set_addr("initrd_high", (void *)min_t(ulong, max_size, + lowmem_size)); + status |= env_set_addr("fdt_high", (void *)min_t(ulong, max_size, + lowmem_size)); + if (status) + printf("%s: Saving run time variables FAILED\n", __func__); return 0; } -- 2.39.5