diff options
author | Simon Glass <sjg@chromium.org> | 2016-09-24 18:20:13 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-10-06 15:08:52 -0400 |
commit | 2a2ee2ac35f26f6b4dae11a225c2803291dff10e (patch) | |
tree | cdb362cf377e85a635bb54dc7bf7f54991914cd3 /common/spl/spl.c | |
parent | 97d9df0a91f1c68695913518d8dfaf26c41dbb32 (diff) |
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.c')
-rw-r--r-- | common/spl/spl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index 84c80345b6..fae3dbc719 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -185,7 +185,8 @@ static ulong spl_ram_load_read(struct spl_load_info *load, ulong sector, return count; } -static int spl_ram_load_image(struct spl_boot_device *bootdev) +static int spl_ram_load_image(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev) { struct image_header *header; @@ -215,7 +216,7 @@ static int spl_ram_load_image(struct spl_boot_device *bootdev) header = (struct image_header *) (CONFIG_SYS_TEXT_BASE - sizeof(struct image_header)); - spl_parse_image_header(&spl_image, header); + spl_parse_image_header(spl_image, header); } return 0; @@ -381,7 +382,7 @@ static int spl_load_image(u32 boot_device) bootdev.boot_device = boot_device; bootdev.boot_device_name = NULL; if (loader) - return loader->load_image(&bootdev); + return loader->load_image(&spl_image, &bootdev); #if defined(CONFIG_SPL_SERIAL_SUPPORT) && defined(CONFIG_SPL_LIBCOMMON_SUPPORT) puts("SPL: Unsupported Boot Device!\n"); |