From 66a8c8f04c7ab341aaa65e18c3af276fa70d5b56 Mon Sep 17 00:00:00 2001 From: Thibaut VARENE Date: Fri, 28 Jul 2017 12:59:42 +0200 Subject: [PATCH] tools/firmware-utils: mktplinkfw2: allow parameter override This patch enables commandline override of board hw_ver and hw_ver_add Signed-off-by: Thibaut VARENE --- tools/firmware-utils/src/mktplinkfw2.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/firmware-utils/src/mktplinkfw2.c b/tools/firmware-utils/src/mktplinkfw2.c index 56330c011e3..7d094774c85 100644 --- a/tools/firmware-utils/src/mktplinkfw2.c +++ b/tools/firmware-utils/src/mktplinkfw2.c @@ -424,17 +424,15 @@ static int check_options(void) board->hw_id = strtoul(opt_hw_id, NULL, 0); - if (opt_hw_rev) - board->hw_rev = strtoul(opt_hw_rev, NULL, 0); - else - board->hw_rev = 1; - - if (opt_hw_ver_add) - board->hw_ver_add = strtoul(opt_hw_ver_add, NULL, 0); - else - board->hw_ver_add = 0; + board->hw_rev = 1; + board->hw_ver_add = 0; } + if (opt_hw_rev) + board->hw_rev = strtoul(opt_hw_rev, NULL, 0); + if (opt_hw_ver_add) + board->hw_ver_add = strtoul(opt_hw_ver_add, NULL, 0); + layout = find_layout(layout_id); if (layout == NULL) { ERR("unknown flash layout \"%s\"", layout_id);