spl: Create a function to init spl_load_info

Rather than having every caller set this up individually, create a
common init function. This allows new fields to be added without the
risk of them being left uninited.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
This commit is contained in:
Simon Glass
2024-08-22 07:55:02 -06:00
committed by Tom Rini
parent 50a1ed4335
commit 3fd11278ff
18 changed files with 57 additions and 76 deletions

View File

@@ -221,9 +221,8 @@ int sandbox_spl_load_fit(char *fname, int maxlen, struct spl_image_info *image)
int ret;
int fd;
memset(&load, '\0', sizeof(load));
spl_set_bl_len(&load, IS_ENABLED(CONFIG_SPL_LOAD_BLOCK) ? 512 : 1);
load.read = read_fit_image;
spl_load_init(&load, read_fit_image, &load_ctx,
IS_ENABLED(CONFIG_SPL_LOAD_BLOCK) ? 512 : 1);
ret = sandbox_find_next_phase(fname, maxlen, true);
if (ret) {