]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm64: zynqmp: Propagate error value from psu_init()
authorMichal Simek <michal.simek@xilinx.com>
Wed, 10 Jan 2018 10:48:48 +0000 (11:48 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 30 Jan 2018 13:28:59 +0000 (14:28 +0100)
psu_init() returns int which wasn't declared and checked.
The patch is fixing function declarations and code to handle return
values properly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/arm/cpu/armv8/zynqmp/spl.c
arch/arm/include/asm/arch-zynqmp/sys_proto.h
board/xilinx/zynqmp/zynqmp.c

index e51e2b6156790db42578e4887056493fc5161d5a..41ca74a2be2be6ec148de47d322f4e0d224d5dcd 100644 (file)
@@ -129,12 +129,13 @@ u32 spl_boot_mode(const u32 boot_device)
        }
 }
 
-__weak void psu_init(void)
+__weak int psu_init(void)
 {
        /*
         * This function is overridden by the one in
         * board/xilinx/zynqmp/(platform)/psu_init_gpl.c, if it exists.
         */
+       return -1;
 }
 
 #ifdef CONFIG_SPL_OS_BOOT
index ad2856863363d0ada08d9abcfeeace3826847e14..4dfabba80a5c0eb5c9c0da44bf24cffcdc078bfd 100644 (file)
@@ -33,7 +33,7 @@ enum {
 int zynq_board_read_rom_ethaddr(unsigned char *ethaddr);
 unsigned int zynqmp_get_silicon_version(void);
 
-void psu_init(void);
+int psu_init(void);
 
 void handoff_setup(void);
 
index 8b6c0ea46698e9597b7c0041799cd4b5ade51159..db557e88067447dca3669254aad5bc2a0c090002 100644 (file)
@@ -237,15 +237,16 @@ static char *zynqmp_get_silicon_idcode_name(void)
 
 int board_early_init_f(void)
 {
+       int ret = 0;
 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_CLK_ZYNQMP)
        zynqmp_pmufw_version();
 #endif
 
 #if defined(CONFIG_SPL_BUILD) || defined(CONFIG_ZYNQMP_PSU_INIT_ENABLED)
-       psu_init();
+       ret = psu_init();
 #endif
 
-       return 0;
+       return ret;
 }
 
 #define ZYNQMP_VERSION_SIZE    9