spl: Add a parameter to spl_parse_image_header()
Instead of using the global spl_image variable, pass the required struct in
as an argument.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/common/spl/spl_ymodem.c b/common/spl/spl_ymodem.c
index 5402301..1323b6f 100644
--- a/common/spl/spl_ymodem.c
+++ b/common/spl/spl_ymodem.c
@@ -108,8 +108,9 @@
while ((res = xyzModem_stream_read(buf, BUF_SIZE, &err)) > 0)
size += res;
} else {
- spl_parse_image_header((struct image_header *)buf);
- ret = spl_parse_image_header((struct image_header *)buf);
+ 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;