Skip to content

Commit d1d5ec6

Browse files
committed
elfloader: make check more intuitive
Signed-off-by: Axel Heider <axelheider@gmx.de>
1 parent fd0a5ec commit d1d5ec6

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

elfloader-tool/src/arch-arm/smp_boot.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ void non_boot_main(void)
4040
}
4141

4242
/* Do any driver specific non_boot core init */
43-
if (initialise_devices_non_boot()) {
44-
printf("ERROR: Did not successfully return from initialise_devices_non_boot()\n");
43+
int ret = initialise_devices_non_boot();
44+
if (0 != ret) {
45+
printf("ERROR: device initialization failed (%d)\n", ret);
4546
abort();
4647
}
4748

elfloader-tool/src/arch-arm/sys_boot.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ void relocate_below_kernel(void)
101101
*/
102102
void main(UNUSED void *arg)
103103
{
104+
int ret;
104105
void *bootloader_dtb = NULL;
105106

106107
/* initialize platform to a state where we can print to a UART */
107-
if (initialise_devices()) {
108-
printf("ERROR: Did not successfully return from initialise_devices()\n");
108+
ret = initialise_devices();
109+
if (0 != ret) {
110+
printf("ERROR: device initialization failed (%d)\n", ret);
109111
abort();
110112
}
111113

@@ -144,8 +146,8 @@ void main(UNUSED void *arg)
144146

145147
/* Unpack ELF images into memory. */
146148
unsigned int num_apps = 0;
147-
int ret = load_images(&kernel_info, &user_info, 1, &num_apps,
148-
bootloader_dtb, &dtb, &dtb_size);
149+
ret = load_images(&kernel_info, &user_info, 1, &num_apps,
150+
bootloader_dtb, &dtb, &dtb_size);
149151
if (0 != ret) {
150152
printf("ERROR: image loading failed\n");
151153
abort();
@@ -179,8 +181,9 @@ void continue_boot(int was_relocated)
179181
* driver model so all its pointers are set up properly.
180182
*/
181183
if (was_relocated) {
182-
if (initialise_devices()) {
183-
printf("ERROR: Did not successfully return from initialise_devices()\n");
184+
int ret = initialise_devices();
185+
if (0 != ret) {
186+
printf("ERROR: device initialization failed (%d)\n", ret);
184187
abort();
185188
}
186189
}

0 commit comments

Comments
 (0)