diff options
author | Simon Glass <sjg@chromium.org> | 2016-09-25 00:20:13 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-10-06 19:08:52 (GMT) |
commit | 2a2ee2ac35f26f6b4dae11a225c2803291dff10e (patch) | |
tree | cdb362cf377e85a635bb54dc7bf7f54991914cd3 /common/spl/spl_onenand.c | |
parent | 97d9df0a91f1c68695913518d8dfaf26c41dbb32 (diff) | |
download | u-boot-2a2ee2ac35f26f6b4dae11a225c2803291dff10e.tar.xz |
spl: Pass spl_image as a parameter to load_image() methods
Rather than having a global variable, pass the spl_image as a parameter.
This avoids BSS use, and makes it clearer what the function is actually
doing.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/spl/spl_onenand.c')
-rw-r--r-- | common/spl/spl_onenand.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/spl/spl_onenand.c b/common/spl/spl_onenand.c index 361a1b3..f076e2c 100644 --- a/common/spl/spl_onenand.c +++ b/common/spl/spl_onenand.c @@ -14,7 +14,8 @@ #include <asm/io.h> #include <onenand_uboot.h> -static int spl_onenand_load_image(struct spl_boot_device *bootdev) +static int spl_onenand_load_image(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev) { struct image_header *header; int ret; @@ -26,11 +27,11 @@ static int spl_onenand_load_image(struct spl_boot_device *bootdev) /* Load u-boot */ onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS, CONFIG_SYS_ONENAND_PAGE_SIZE, (void *)header); - ret = spl_parse_image_header(&spl_image, header); + ret = spl_parse_image_header(spl_image, header); if (ret) return ret; onenand_spl_load_image(CONFIG_SYS_ONENAND_U_BOOT_OFFS, - spl_image.size, (void *)spl_image.load_addr); + spl_image->size, (void *)spl_image->load_addr); return 0; } |