summaryrefslogtreecommitdiff
path: root/common/spl/spl_ubi.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-09-24 18:20:13 -0600
committerTom Rini <trini@konsulko.com>2016-10-06 15:08:52 -0400
commit2a2ee2ac35f26f6b4dae11a225c2803291dff10e (patch)
treecdb362cf377e85a635bb54dc7bf7f54991914cd3 /common/spl/spl_ubi.c
parent97d9df0a91f1c68695913518d8dfaf26c41dbb32 (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_ubi.c')
-rw-r--r--common/spl/spl_ubi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/spl/spl_ubi.c b/common/spl/spl_ubi.c
index 3ef00aa0b0..c03910bb40 100644
--- a/common/spl/spl_ubi.c
+++ b/common/spl/spl_ubi.c
@@ -12,7 +12,8 @@
#include <ubispl.h>
#include <spl.h>
-int spl_ubi_load_image(struct spl_boot_device *bootdev)
+int spl_ubi_load_image(struct spl_image_info *spl_image,
+ struct spl_boot_device *bootdev)
{
struct image_header *header;
struct ubispl_info info;
@@ -54,7 +55,7 @@ int spl_ubi_load_image(struct spl_boot_device *bootdev)
ret = ubispl_load_volumes(&info, volumes, 2);
if (!ret) {
header = (struct image_header *)volumes[0].load_addr;
- spl_parse_image_header(&spl_image, header);
+ spl_parse_image_header(spl_image, header);
puts("Linux loaded.\n");
goto out;
}
@@ -68,7 +69,7 @@ int spl_ubi_load_image(struct spl_boot_device *bootdev)
ret = ubispl_load_volumes(&info, volumes, 1);
if (!ret)
- spl_parse_image_header(&spl_image, header);
+ spl_parse_image_header(spl_image, header);
out:
#ifdef CONFIG_SPL_NAND_SUPPORT
if (bootdev->boot_device == BOOT_DEVICE_NAND)