CONFIG_DEFAULT_PROGRAMMER_NAME: Use programmer name instead of enum

CONFIG_DEFAULT_PROGRAMER_NAME replaces CONFIG_DEFAULT_PROGRAMMER.
It uses the name of the programmer for identification.
make CONFIG_DEFAULT_PROGRAMER_NAME=dummy and
meson -Ddefault_programmer_name=dummy will extend to
CONFIG_DEFAULT_PROGRAMER_NAME=&programmer_dummy in the code.

Change-Id: I976447787c6f6bfbdc0145d80d61e1ddcf97ac33
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/55123
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71380
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/cli_classic.c b/cli_classic.c
index f20166c..be2f86c 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -121,7 +121,6 @@
 	int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
 	int dont_verify_it = 0, dont_verify_all = 0, list_supported = 0, operation_specified = 0;
 	struct flashrom_layout *layout = NULL;
-	// enum programmer prog = PROGRAMMER_INVALID;
 	static const struct programmer_entry *prog = NULL;
 	enum {
 		OPTION_IFD = 0x0100,
@@ -440,12 +439,14 @@
 	}
 
 	if (prog == NULL) {
-		if (CONFIG_DEFAULT_PROGRAMMER != PROGRAMMER_INVALID) {
-			prog = programmer_table[CONFIG_DEFAULT_PROGRAMMER];
+		const struct programmer_entry *const default_programmer = CONFIG_DEFAULT_PROGRAMMER_NAME;
+
+		if (default_programmer) {
+			prog = default_programmer;
 			/* We need to strdup here because we free(pparam) unconditionally later. */
 			pparam = strdup(CONFIG_DEFAULT_PROGRAMMER_ARGS);
 			msg_pinfo("Using default programmer \"%s\" with arguments \"%s\".\n",
-				  programmer_table[CONFIG_DEFAULT_PROGRAMMER]->name, pparam);
+				  default_programmer->name, pparam);
 		} else {
 			msg_perr("Please select a programmer with the --programmer parameter.\n"
 #if CONFIG_INTERNAL == 1