aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-11 09:47:07 -0600
committerSimon Glass <sjg@chromium.org>2022-10-17 21:17:12 -0600
commit13819f07ea6c60e87b708755a53954b8c0c99a32 (patch)
treef79b78744dfeebebb37758280ece9414392bbd62
parente44d7e73fe0d649693d8d0a110cd7632bc919273 (diff)
downloadu-boot-13819f07ea6c60e87b708755a53954b8c0c99a32.zip
u-boot-13819f07ea6c60e87b708755a53954b8c0c99a32.tar.gz
u-boot-13819f07ea6c60e87b708755a53954b8c0c99a32.tar.bz2
bootm: Change incorrect 'unsupported' error
At present when bootm fails, it says: subcommand not supported and then prints help for the bootm command. This is not very useful, since generally the error is related to something else, such as fixups failing. It is quite confusing to see this in a test run. Change the error and show the error code. We could update the OS functions to return -ENOSYS when they do not support the bootm subcommand. But this involves some thought since this is arch-specific code and proper errno error codes are not always returned. Also, with the code as is, all required subcommands are of course supported - a problem would only come if someone added a new one or removed support for one from an existing OS. Therefore it seems better to leave that sort of effort for when our bootm tests are improved. Note: v1 of this patch generated a discussion[1] about printing error strings automatically using printf(). That is outside the scope of this patch but will be dealt with separately. [1] https://patchwork.ozlabs.org/project/uboot/patch/20220909151801.336551-3-sjg@chromium.org/ Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--boot/bootm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/boot/bootm.c b/boot/bootm.c
index 5b20b41..a4c0870 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -790,7 +790,7 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc,
/* Check for unsupported subcommand. */
if (ret) {
- puts("subcommand not supported\n");
+ printf("subcommand failed (err=%d)\n", ret);
return ret;
}