From fd0d41353777804d890caf150c749da928da4d79 Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Tue, 25 Sep 2012 21:24:55 +0000 Subject: Introduce a compile time option to select a default programmer Heavily influenced by a discussion with (and based on code from) Peter Stuge. Please read the comment in the Makefile before using this option. Corresponding to flashrom svn r1607. Signed-off-by: Stefan Tauner Acked-by: Peter Stuge --- cli_classic.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'cli_classic.c') diff --git a/cli_classic.c b/cli_classic.c index 58696adf9..4ae375cfa 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -402,11 +402,17 @@ int main(int argc, char *argv[]) } if (prog == PROGRAMMER_INVALID) { - msg_perr("Please select a programmer with the --programmer parameter.\n" - "Valid choices are:\n"); - list_programmers_linebreak(0, 80, 0); - ret = 1; - goto out; + if (CONFIG_DEFAULT_PROGRAMMER != PROGRAMMER_INVALID) { + prog = CONFIG_DEFAULT_PROGRAMMER; + msg_pinfo("Using default programmer \"%s\".\n", + programmer_table[CONFIG_DEFAULT_PROGRAMMER].name); + } else { + msg_perr("Please select a programmer with the --programmer parameter.\n" + "Valid choices are:\n"); + list_programmers_linebreak(0, 80, 0); + ret = 1; + goto out; + } } /* FIXME: Delay calibration should happen in programmer code. */ -- cgit v1.2.3