Update this function to add the image to the list.
Signed-off-by: Simon Glass <sjg@chromium.org>
}
int bootmeth_alloc_other(struct bootflow *bflow, const char *fname,
- void **bufp, uint *sizep)
+ enum bootflow_img_t type, void **bufp, uint *sizep)
{
struct blk_desc *desc = NULL;
char path[200];
if (ret)
return log_msg_ret("all", ret);
+ if (!bootflow_img_add(bflow, bflow->fname, type, map_to_sysmem(buf),
+ size))
+ return log_msg_ret("boi", -ENOMEM);
+
*bufp = buf;
*sizep = size;
if (ret)
return log_msg_ret("inf", ret);
- ret = bootmeth_alloc_other(bflow, "boot.bmp", &bflow->logo,
- &bflow->logo_size);
+ ret = bootmeth_alloc_other(bflow, "boot.bmp", BFI_LOGO,
+ &bflow->logo, &bflow->logo_size);
/* ignore error */
return 0;
*
* @bflow: Information about file to read
* @fname: Filename to read from (within bootflow->subdir)
+ * @type: File type (IH_TYPE_...)
* @bufp: Returns a pointer to the allocated buffer
* @sizep: Returns the size of the buffer
* Return: 0 if OK, -ENOMEM if out of memory, other -ve on other error
*/
int bootmeth_alloc_other(struct bootflow *bflow, const char *fname,
- void **bufp, uint *sizep);
+ enum bootflow_img_t type, void **bufp, uint *sizep);
/**
* bootmeth_common_read_file() - Common handler for reading a file