summaryrefslogtreecommitdiff
path: root/common/spl/spl_fat.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-08-22 07:55:02 -0600
committerTom Rini <trini@konsulko.com>2024-08-23 15:58:42 -0600
commit3fd11278ff43a5039e33a8cf04dc822711ea9694 (patch)
tree62818649b8a5605cefe4795c0fb4a24b8a087e39 /common/spl/spl_fat.c
parent50a1ed4335045c57d9073a3fcd265edd89da924a (diff)
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>
Diffstat (limited to 'common/spl/spl_fat.c')
-rw-r--r--common/spl/spl_fat.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index bd8aab253a9..fce451b7664 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -83,12 +83,10 @@ int spl_load_image_fat(struct spl_image_info *spl_image,
size = 0;
}
- load.read = spl_fit_read;
- if (IS_ENABLED(CONFIG_SPL_FS_FAT_DMA_ALIGN))
- spl_set_bl_len(&load, ARCH_DMA_MINALIGN);
- else
- spl_set_bl_len(&load, 1);
- load.priv = (void *)filename;
+ spl_load_init(&load, spl_fit_read, (void *)filename,
+ IS_ENABLED(CONFIG_SPL_FS_FAT_DMA_ALIGN) ?
+ ARCH_DMA_MINALIGN : 1);
+
err = spl_load(spl_image, bootdev, &load, size, 0);
end: