layout: Kill the global layout

Change-Id: Ic302e9c5faf1368e5ca244ce461e55e14f916ab8
Signed-off-by: Nico Huber <nico.h@gmx.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/54286
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72222
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/cli_classic.c b/cli_classic.c
index e0b5094..c222325 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -440,12 +440,12 @@
 	}
 	msg_gdbg("\n");
 
-	if (layoutfile && read_romlayout(layoutfile)) {
+	if (layoutfile && layout_from_file(&layout, layoutfile)) {
 		ret = 1;
 		goto out;
 	}
 
-	if (!ifd && !fmap && process_include_args(get_global_layout(), include_args)) {
+	if (!ifd && !fmap && process_include_args(layout, include_args)) {
 		ret = 1;
 		goto out;
 	}
@@ -615,9 +615,7 @@
 		goto out_shutdown;
 	}
 
-	if (layoutfile) {
-		layout = get_global_layout();
-	} else if (ifd && (flashrom_layout_read_from_ifd(&layout, fill_flash, NULL, 0) ||
+	if (ifd && (flashrom_layout_read_from_ifd(&layout, fill_flash, NULL, 0) ||
 			   process_include_args(layout, include_args))) {
 		ret = 1;
 		goto out_shutdown;