summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-05-24 17:38:24 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-05-27 14:40:09 +0800
commit0621b5e1eeb6bcf08b220136f09d433d880f65a5 (patch)
treea007bea38f55122ef7c74169e22106c8efeaf42f /fs
parent03d4c298fa801139b37108fab83cb312209d6092 (diff)
cbfs: Don't require the CBFS size with cbfs_init_mem()
The size is not actually used since it is present in the header. Drop this parameter. Also tidy up error handling while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cbfs/cbfs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c
index d3c3722c48..9007aa7d15 100644
--- a/fs/cbfs/cbfs.c
+++ b/fs/cbfs/cbfs.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <cbfs.h>
+#include <log.h>
#include <malloc.h>
#include <asm/byteorder.h>
@@ -275,7 +276,7 @@ int file_cbfs_init(ulong end_of_rom)
return cbfs_init(&cbfs_s, end_of_rom);
}
-int cbfs_init_mem(ulong base, ulong size, struct cbfs_priv **privp)
+int cbfs_init_mem(ulong base, struct cbfs_priv **privp)
{
struct cbfs_priv priv_s, *priv = &priv_s;
int ret;
@@ -288,9 +289,10 @@ int cbfs_init_mem(ulong base, ulong size, struct cbfs_priv **privp)
if (ret)
return ret;
- file_cbfs_fill_cache(priv, priv->header.rom_size, priv->header.align);
- if (priv->result != CBFS_SUCCESS)
- return -EINVAL;
+ ret = file_cbfs_fill_cache(priv, priv->header.rom_size,
+ priv->header.align);
+ if (ret)
+ return log_msg_ret("fill", ret);
priv->initialized = true;
priv = malloc(sizeof(priv_s));