diff options
author | Vladimir Serbinenko <phcoder@gmail.com> | 2014-01-12 14:12:15 +0100 |
---|---|---|
committer | Vladimir Serbinenko <phcoder@gmail.com> | 2014-01-12 17:41:58 +0100 |
commit | 128741682250e196ccc9ff0bf9e7a5db5dfcdbd3 (patch) | |
tree | 77f3adb8046d81cacd650ad77aa4aaf18cc6d3a7 /src/mainboard/google/butterfly | |
parent | 0af61b6c82d7ff02426a26bf435b7c6ee768a602 (diff) |
CBFS: use cbfs_get_file_content whenever possible rather than cbfs_get_file
Number one reason to use cbfs_get_file was to get file length.
With previous patch no more need for this.
Change-Id: I330dda914d800c991757c5967b11963276ba9e00
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-on: http://review.coreboot.org/4674
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/mainboard/google/butterfly')
-rw-r--r-- | src/mainboard/google/butterfly/mainboard.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mainboard/google/butterfly/mainboard.c b/src/mainboard/google/butterfly/mainboard.c index 1623fe01c6..f65d14c7f5 100644 --- a/src/mainboard/google/butterfly/mainboard.c +++ b/src/mainboard/google/butterfly/mainboard.c @@ -299,7 +299,7 @@ static void verb_setup(void) static void mainboard_init(device_t dev) { u32 search_address = 0x0; - u32 search_length = -1; + size_t search_length = -1; u16 io_base = 0; struct device *ethernet_dev = NULL; #if CONFIG_CHROMEOS @@ -307,10 +307,12 @@ static void mainboard_init(device_t dev) search_length = find_fmap_entry("RO_VPD", (void **)vpd_region_ptr); search_address = (unsigned long)(*vpd_region_ptr); #else - struct cbfs_file *vpd_file = cbfs_get_file(CBFS_DEFAULT_MEDIA, "vpd.bin"); + void *vpd_file = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, "vpd.bin", &search_length); if (vpd_file) { - search_length = ntohl(vpd_file->len); - search_address = (unsigned long)CBFS_SUBHEADER(vpd_file); + search_address = (unsigned long)vpd_file; + } else { + search_length = -1; + search_address = 0; } #endif |