aboutsummaryrefslogtreecommitdiff
path: root/lib/initcall.c
diff options
context:
space:
mode:
authorSimon Glass2023-08-21 21:16:52 -0600
committerTom Rini2023-08-31 13:16:54 -0400
commit13123276806f5a2e209bd1ae16c894e0415e520d (patch)
tree1520f892b8d2fdcf9d7baba742d478a9c0620632 /lib/initcall.c
parent468e372e9ad4c551d513b2e73c1f5c1cbb2e4097 (diff)
initcall: Adjust the failure message and return value
Move the failure message outside the loop, so it is easier to follow the code. Avoid swallowing the error code - just pass it along. Drop the initcall-list address from the output. This is confusing since we show two addresses. Really it is only the function address which is useful, since it can be looked up in the map, e.g. with: grep -A1 -B1 serial_init u-boot.map Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/initcall.c')
-rw-r--r--lib/initcall.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/initcall.c b/lib/initcall.c
index 81c5d245073..0f74cef32f8 100644
--- a/lib/initcall.c
+++ b/lib/initcall.c
@@ -46,11 +46,13 @@ int initcall_run_list(const init_fnc_t init_sequence[])
}
ret = func();
- if (ret) {
- printf("initcall sequence %p failed at call %p (err=%d)\n",
- init_sequence, (char *)func - reloc_ofs, ret);
- return -1;
- }
+ }
+
+ if (ret) {
+ printf("initcall failed at call %p (err=%dE)\n",
+ (char *)func - reloc_ofs, ret);
+
+ return ret;
}
return 0;