spl: Report a loader failure
If a loader returns an error code it is silently ignored. Show a message to at least provide some feedback to the user. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -612,6 +612,7 @@ static int boot_from_devices(struct spl_image_info *spl_image,
|
||||
for (i = 0; i < count && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) {
|
||||
struct spl_image_loader *loader;
|
||||
int bootdev = spl_boot_list[i];
|
||||
int ret;
|
||||
|
||||
if (CONFIG_IS_ENABLED(SHOW_ERRORS))
|
||||
ret = -ENXIO;
|
||||
@@ -631,10 +632,13 @@ static int boot_from_devices(struct spl_image_info *spl_image,
|
||||
"Unsupported Boot Device!\n");
|
||||
}
|
||||
}
|
||||
if (loader &&
|
||||
!spl_load_image(spl_image, loader)) {
|
||||
spl_image->boot_device = bootdev;
|
||||
return 0;
|
||||
if (loader) {
|
||||
ret = spl_load_image(spl_image, loader);
|
||||
if (!ret) {
|
||||
spl_image->boot_device = bootdev;
|
||||
return 0;
|
||||
}
|
||||
printf("Error: %d\n", ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user