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

@@ -43,9 +43,7 @@ static int spl_smh_load_image(struct spl_image_info *spl_image,
}
len = ret;
load.read = smh_fit_read;
spl_set_bl_len(&load, 1);
load.priv = &fd;
spl_load_init(&load, smh_fit_read, &fd, 1);
ret = spl_load(spl_image, bootdev, &load, len, 0);
if (ret)
log_debug("could not read %s: %d\n", filename, ret);