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_ymodem.c | |
parent | 97d9df0a91f1c68695913518d8dfaf26c41dbb32 (diff) | |
download | u-boot-imx-2a2ee2ac35f26f6b4dae11a225c2803291dff10e.zip u-boot-imx-2a2ee2ac35f26f6b4dae11a225c2803291dff10e.tar.gz u-boot-imx-2a2ee2ac35f26f6b4dae11a225c2803291dff10e.tar.bz2 |
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_ymodem.c')
-rw-r--r-- | common/spl/spl_ymodem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c index 168b951..8fbf895 100644 --- a/common/spl/spl_ymodem.c +++ b/common/spl/spl_ymodem.c @@ -68,7 +68,8 @@ static ulong ymodem_read_fit(struct spl_load_info *load, ulong offset, return size; } -static int spl_ymodem_load_image(struct spl_boot_device *bootdev) +static int spl_ymodem_load_image(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev) { int size = 0; int err; @@ -108,12 +109,12 @@ static int spl_ymodem_load_image(struct spl_boot_device *bootdev) while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0) size += res; } else { - spl_parse_image_header(&spl_image, (struct image_header *)buf); - ret = spl_parse_image_header(&spl_image, + spl_parse_image_header(spl_image, (struct image_header *)buf); + ret = spl_parse_image_header(spl_image, (struct image_header *)buf); if (ret) return ret; - addr = spl_image.load_addr; + addr = spl_image->load_addr; memcpy((void *)addr, buf, res); size += res; addr += res; |