From 128741682250e196ccc9ff0bf9e7a5db5dfcdbd3 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 12 Jan 2014 14:12:15 +0100 Subject: 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 Reviewed-on: http://review.coreboot.org/4674 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/mainboard/google/butterfly/mainboard.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mainboard/google/butterfly') 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 -- cgit v1.2.3