
Handle the error code returned by cyclic_register(). Report the error, but do not return it from board_late_init() as that would make the board not boot, which is undesired. Let the board boot somehow, so the user can fix the problem, even if the cyclic callback is not usable.
Signed-off-by: Marek Vasut marek.vasut+renesas@mailbox.org --- Cc: Aaron Williams awilliams@marvell.com Cc: Anatolij Gustschin agust@denx.de Cc: Angelo Dureghello angelo@kernel-space.org Cc: Christian Marangi ansuelsmth@gmail.com Cc: Devarsh Thakkar devarsht@ti.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jaehoon Chung jh80.chung@samsung.com Cc: Michael Polyntsov michael.polyntsov@iopsys.eu Cc: Michael Trimarchi michael@amarulasolutions.com Cc: Nikhil M Jain n-jain1@ti.com Cc: Peng Fan peng.fan@nxp.com Cc: Peter Robinson pbrobinson@gmail.com Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Ronald Wahl ronald.wahl@legrand.com Cc: Simon Glass sjg@chromium.org Cc: Stefan Roese sr@denx.de Cc: Tim Harvey tharvey@gateworks.com Cc: Tom Rini trini@konsulko.com Cc: u-boot@lists.denx.de --- board/Marvell/octeon_nic23/board.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/board/Marvell/octeon_nic23/board.c b/board/Marvell/octeon_nic23/board.c index cf20c97684a..5d1bf15ed50 100644 --- a/board/Marvell/octeon_nic23/board.c +++ b/board/Marvell/octeon_nic23/board.c @@ -341,6 +341,7 @@ int board_late_init(void) struct cyclic_info *cyclic; struct gpio_desc gpio = {}; ofnode node; + int ret;
/* Turn on SFP+ transmitters */ ofnode_for_each_compatible_node(node, "ethernet,sfp-slot") { @@ -358,13 +359,18 @@ int board_late_init(void)
/* Register cyclic function for PCIe FLR fixup */ cyclic = calloc(1, sizeof(*cyclic)); - if (cyclic) { - cyclic_register(cyclic, octeon_board_restore_pf, 100, - "pcie_flr_fix"); - } else { - printf("Registering of cyclic function failed\n"); + if (!cyclic) { + printf("Registering of cyclic function failed, ENOMEM\n"); + /* Do not exit with error code, let the board boot somehow. */ + return 0; }
+ ret = cyclic_register(cyclic, octeon_board_restore_pf, 100, + "pcie_flr_fix"); + /* Do not exit with error code, let the board boot somehow. */ + if (ret) + printf("Registering of cyclic function failed, %d\n", ret); + return 0; }