Edward O'Callaghan has uploaded this change for review.

View Change

programmer_table.c: Allow name_to_entry() to return default when set

Change-Id: I75fd24a76d0f6f25072428a8d992a1977c4ad1f8
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M programmer_table.c
1 file changed, 16 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/21/72821/1
diff --git a/programmer_table.c b/programmer_table.c
index 46f7c61..c4834d0 100644
--- a/programmer_table.c
+++ b/programmer_table.c
@@ -181,6 +181,12 @@
{
unsigned prog;

+ if (strlen(name) == 0) {
+ const struct programmer_entry *const default_programmer = CONFIG_DEFAULT_PROGRAMMER_NAME;
+ if (default_programmer)
+ return default_programmer;
+ }
+
for (prog = 0; prog < programmer_table_size; prog++) {
if (strcmp(name, programmer_table[prog]->name) == 0)
break;

To view, visit change 72821. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I75fd24a76d0f6f25072428a8d992a1977c4ad1f8
Gerrit-Change-Number: 72821
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange