aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-12-03 17:29:32 -0700
committerTom Rini <trini@konsulko.com>2024-04-10 13:49:16 -0600
commitcb19931ee56f52779d6dba97a0934afe97167840 (patch)
tree1b1f25fe514ca970a0c4028c0269e1b3595c0a6d
parentdb0c6f47c37f91db5a0caf27ebc870b8fe72c6aa (diff)
downloadu-boot-cb19931ee56f52779d6dba97a0934afe97167840.zip
u-boot-cb19931ee56f52779d6dba97a0934afe97167840.tar.gz
u-boot-cb19931ee56f52779d6dba97a0934afe97167840.tar.bz2
x86: zboot: Drop intermediate zboot_setup() function
Move error checking into the caller so that do_zboot_setup() can call zboot_setup() directly. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--cmd/x86/zboot.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c
index d39ab6a..f392b6b 100644
--- a/cmd/x86/zboot.c
+++ b/cmd/x86/zboot.c
@@ -74,11 +74,10 @@ static int do_zboot_load(struct cmd_tbl *cmdtp, int flag, int argc,
return 0;
}
-static int _zboot_setup(void)
+static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
- struct boot_params *base_ptr = state.base_ptr;
-
- if (!base_ptr) {
+ if (!state.base_ptr) {
printf("base is not set: use 'zboot load' first\n");
return CMD_RET_FAILURE;
}
@@ -87,13 +86,10 @@ static int _zboot_setup(void)
return CMD_RET_FAILURE;
}
- return 0;
-}
+ if (zboot_setup())
+ return CMD_RET_FAILURE;
-static int do_zboot_setup(struct cmd_tbl *cmdtp, int flag, int argc,
- char *const argv[])
-{
- return _zboot_setup();
+ return 0;
}
static void zboot_info(void)