diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-27 17:43:26 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-11-29 21:03:17 +0100 |
commit | d4950552f5c7e95b04f9a69809542080483ca77d (patch) | |
tree | e9ecca147e160ad8d5d71bc5ef062fedfde829fa /commands | |
parent | 351058fa51dbc010c37906b46ecf67a41dbbad8d (diff) | |
download | barebox-d4950552f5c7e95b04f9a69809542080483ca77d.tar.gz barebox-d4950552f5c7e95b04f9a69809542080483ca77d.tar.xz |
bootm: use initrd_address and initrd_size
Make these fields in struct image_data the reference for image handlers
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/bootm.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/commands/bootm.c b/commands/bootm.c index cad7b21261..0722e92461 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -181,9 +181,6 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[]) } } - if (data.initrd && data.initrd_address != ~0) - data.initrd->header.ih_load = cpu_to_uimage(data.initrd_address); - if (optind == argc) { ret = COMMAND_ERROR_USAGE; goto err_out; @@ -221,8 +218,12 @@ static int do_bootm(struct command *cmdtp, int argc, char *argv[]) goto err_out; if (data.initrd) { - ret = relocate_image(data.initrd, - (void *)image_get_load(&data.initrd->header)); + if (data.initrd && data.initrd_address == ~0) + data.initrd_address = uimage_to_cpu(data.initrd->header.ih_load); + + data.initrd_size = image_get_data_size(&data.initrd->header); + + ret = relocate_image(data.initrd, (void *)data.initrd_address); if (ret) goto err_out; } |