tools/firmware-utils: mktplinkfw2: allow parameter override
authorThibaut VARENE <hacks@slashdirt.org>
Fri, 28 Jul 2017 10:59:42 +0000 (12:59 +0200)
committerMathias Kresin <dev@kresin.me>
Sat, 9 Sep 2017 07:55:26 +0000 (09:55 +0200)
This patch enables commandline override of board hw_ver and hw_ver_add

Signed-off-by: Thibaut VARENE <hacks@slashdirt.org>
tools/firmware-utils/src/mktplinkfw2.c

index 56330c011e3cf07cca46494b0800af5f797e1386..7d094774c85dbb2413162483113472dbf56fe6c3 100644 (file)
@@ -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);