cbfstool: prefer fmap data over cbfs master header if it exists

Up to now, if both fmap and a master header existed, the master header
was used. Now, use the master header only if no fmap is found.

Change-Id: Iafbf2c9dc325597e23a9780b495549b5d912e9ad
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: http://review.coreboot.org/11629
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index bf589a5..35747d3 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -881,12 +881,6 @@
 	return cbfs_copy_instance(&image, param.copyoffset, param.size);
 }
 
-static bool cbfs_is_legacy_format(struct buffer *buffer)
-{
-	// Legacy CBFSes are those containing the deprecated CBFS master header.
-	return cbfs_find_header(buffer->data, buffer->size, -1);
-}
-
 static const struct command commands[] = {
 	{"add", "H:r:f:n:t:c:b:a:vh?", cbfs_add, true, true},
 	{"add-flat-binary", "H:r:f:n:l:e:c:b:vh?", cbfs_add_flat_binary, true,
@@ -1250,8 +1244,7 @@
 			}
 		} else {
 			param.image_file =
-				partitioned_file_reopen(image_name,
-							cbfs_is_legacy_format);
+				partitioned_file_reopen(image_name);
 		}
 		if (!param.image_file)
 			return 1;