spl: legacy: Split off LZMA decompression into its own function

To allow for easier reuse of this functionality, split it off into its
own function.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Sean Anderson
2023-11-16 13:49:14 -05:00
committed by Tom Rini
parent 0ddfa868ba
commit efe92cd2f9
2 changed files with 52 additions and 34 deletions
+13
View File
@@ -407,6 +407,19 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
#define SPL_COPY_PAYLOAD_ONLY 1
#define SPL_FIT_FOUND 2
/**
* spl_load_legacy_lzma() - Load an LZMA-compressed legacy image
* @spl_image: Image description (already set up)
* @load: Structure containing the information required to load data.
* @offset: Pointer to image
*
* Load/decompress an LZMA-compressed legacy image from the device.
*
* Return: 0 on success, or a negative error on failure
*/
int spl_load_legacy_lzma(struct spl_image_info *spl_image,
struct spl_load_info *load, ulong offset);
/**
* spl_load_legacy_img() - Loads a legacy image from a device.
* @spl_image: Image description to set up