}
/* Get the CBFS header out of the ROM and do endian conversion. */
-static int file_cbfs_load_header(ulong end_of_rom, struct cbfs_header *header)
+static int file_cbfs_load_header(struct cbfs_priv *priv, ulong end_of_rom)
{
+ struct cbfs_header *header = &priv->header;
struct cbfs_header *header_in_rom;
int32_t offset = *(u32 *)(end_of_rom - 3);
if (header->magic != good_magic || header->offset >
header->rom_size - header->boot_block_size) {
- cbfs_s.result = CBFS_BAD_HEADER;
+ priv->result = CBFS_BAD_HEADER;
return 1;
}
return 0;
priv->initialized = false;
- if (file_cbfs_load_header(end_of_rom, &priv->header))
+ if (file_cbfs_load_header(priv, end_of_rom))
return;
start_of_rom = (u8 *)(end_of_rom + 1 - priv->header.rom_size);
u32 align;
static struct cbfs_cachenode node;
- if (file_cbfs_load_header(end_of_rom, &priv->header))
+ if (file_cbfs_load_header(priv, end_of_rom))
return NULL;
start = (u8 *)(end_of_rom + 1 - priv->header.rom_size);