summaryrefslogtreecommitdiffstats
path: root/commands/boot.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-01-15 12:57:56 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-01-26 22:45:40 +0100
commitbc94fb379a46f9b4dabc982953a8d553c909bedb (patch)
tree7e1dff5e7d4f26f92bbf40ebb531a982d58dcde6 /commands/boot.c
parenta8531386ffdd3f0327bcd22a4b1447477453ad26 (diff)
downloadbarebox-bc94fb379a46f9b4dabc982953a8d553c909bedb.tar.gz
barebox-bc94fb379a46f9b4dabc982953a8d553c909bedb.tar.xz
bootm: Initialize bootm_data defaults in single place
Both the bootm and the boot code initialize the struct bootm_data with defaults from the bootm global variables. Create a common function for doing this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/boot.c')
-rw-r--r--commands/boot.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/commands/boot.c b/commands/boot.c
index fd58824d98..f403010130 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -42,13 +42,9 @@ static int timeout;
static int boot_script(char *path)
{
int ret;
- struct bootm_data data = {
- .os_address = UIMAGE_SOME_ADDRESS,
- .initrd_address = UIMAGE_SOME_ADDRESS,
- };
+ struct bootm_data data = {};
globalvar_set_match("linux.bootargs.dyn.", "");
- globalvar_set_match("bootm.", "");
ret = run_command(path);
if (ret) {
@@ -56,15 +52,9 @@ static int boot_script(char *path)
goto out;
}
- data.initrd_address = UIMAGE_INVALID_ADDRESS;
- data.os_address = UIMAGE_SOME_ADDRESS;
- data.oftree_file = getenv_nonempty("global.bootm.oftree");
- data.os_file = getenv_nonempty("global.bootm.image");
- getenv_ul("global.bootm.image.loadaddr", &data.os_address);
- getenv_ul("global.bootm.initrd.loadaddr", &data.initrd_address);
- data.initrd_file = getenv_nonempty("global.bootm.initrd");
data.verbose = verbose;
data.dryrun = dryrun;
+ bootm_data_init_defaults(&data);
ret = bootm_boot(&data);
if (ret)