diff options
author | Simon Glass <sjg@chromium.org> | 2023-12-15 20:14:20 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-12-21 16:07:52 -0500 |
commit | 725ddf1f24f7d08aa344f64d06c62cf5f50a6b6c (patch) | |
tree | 6e62207676bac6f3ddc21d93c42c5592ed1a9061 /boot | |
parent | b5d397f4898ce03fc241aeb2a4a82bbcdd455b44 (diff) | |
download | u-boot-725ddf1f24f7d08aa344f64d06c62cf5f50a6b6c.tar.gz u-boot-725ddf1f24f7d08aa344f64d06c62cf5f50a6b6c.tar.bz2 u-boot-725ddf1f24f7d08aa344f64d06c62cf5f50a6b6c.zip |
bootm: Tidy up boot_selected_os()
Use struct bootm_info with this function, to avoiding needing to
create a new one.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'boot')
-rw-r--r-- | boot/bootm.c | 6 | ||||
-rw-r--r-- | boot/bootm_os.c | 11 |
2 files changed, 5 insertions, 12 deletions
diff --git a/boot/bootm.c b/boot/bootm.c index f009e9ace6..66b7e350aa 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -1092,8 +1092,7 @@ int bootm_run_states(struct bootm_info *bmi, int states) if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) { char *cmd_list = env_get("fakegocmd"); - ret = boot_selected_os(bmi->argc, bmi->argv, - BOOTM_STATE_OS_FAKE_GO, images, boot_fn); + ret = boot_selected_os(BOOTM_STATE_OS_FAKE_GO, bmi, boot_fn); if (!ret && cmd_list) ret = run_command_list(cmd_list, -1, 0); } @@ -1107,8 +1106,7 @@ int bootm_run_states(struct bootm_info *bmi, int states) /* Now run the OS! We hope this doesn't return */ if (!ret && (states & BOOTM_STATE_OS_GO)) - ret = boot_selected_os(bmi->argc, bmi->argv, BOOTM_STATE_OS_GO, - images, boot_fn); + ret = boot_selected_os(BOOTM_STATE_OS_GO, bmi, boot_fn); /* Deal with any fallout */ err: diff --git a/boot/bootm_os.c b/boot/bootm_os.c index 4f547b1b11..47a5fd78fb 100644 --- a/boot/bootm_os.c +++ b/boot/bootm_os.c @@ -566,20 +566,15 @@ __weak void board_preboot_os(void) /* please define board specific board_preboot_os() */ } -int boot_selected_os(int argc, char *const argv[], int state, - struct bootm_headers *images, boot_os_fn *boot_fn) +int boot_selected_os(int state, struct bootm_info *bmi, boot_os_fn *boot_fn) { - struct bootm_info bmi; arch_preboot_os(); board_preboot_os(); - bmi.argc = argc; - bmi.argv = argv; - bmi.images = images; - boot_fn(state, &bmi); + boot_fn(state, bmi); /* Stand-alone may return when 'autostart' is 'no' */ - if (images->os.type == IH_TYPE_STANDALONE || + if (bmi->images->os.type == IH_TYPE_STANDALONE || IS_ENABLED(CONFIG_SANDBOX) || state == BOOTM_STATE_OS_FAKE_GO) /* We expect to return */ return 0; |