carl9170: Update to latest upstream
[linux-libre-firmware.git] / carl9170fw / config / conf.c
index 5f1758c73ccf1762114c542ce08bbd5340822550..1f9dbc05de95d196bc9f7df0144be9836df82bfd 100644 (file)
@@ -11,7 +11,6 @@
 #include <time.h>
 #include <unistd.h>
 #include <getopt.h>
-#include <sys/stat.h>
 #include <sys/time.h>
 #include <errno.h>
 
@@ -34,6 +33,8 @@ enum input_mode {
        listnewconfig,
        helpnewconfig,
        olddefconfig,
+       yes2modconfig,
+       mod2yesconfig,
 };
 static enum input_mode input_mode = oldaskconfig;
 
@@ -467,6 +468,8 @@ static struct option long_opts[] = {
        {"listnewconfig",   no_argument,       NULL, listnewconfig},
        {"helpnewconfig",   no_argument,       NULL, helpnewconfig},
        {"olddefconfig",    no_argument,       NULL, olddefconfig},
+       {"yes2modconfig",   no_argument,       NULL, yes2modconfig},
+       {"mod2yesconfig",   no_argument,       NULL, mod2yesconfig},
        {NULL, 0, NULL, 0}
 };
 
@@ -489,6 +492,8 @@ static void conf_usage(const char *progname)
        printf("  --allmodconfig          New config where all options are answered with mod\n");
        printf("  --alldefconfig          New config with all symbols set to default\n");
        printf("  --randconfig            New config with random answer to all options\n");
+       printf("  --yes2modconfig         Change answers from yes to mod if possible\n");
+       printf("  --mod2yesconfig         Change answers from mod to yes if possible\n");
 }
 
 int main(int ac, char **av)
@@ -553,6 +558,8 @@ int main(int ac, char **av)
                case listnewconfig:
                case helpnewconfig:
                case olddefconfig:
+               case yes2modconfig:
+               case mod2yesconfig:
                        break;
                case '?':
                        conf_usage(progname);
@@ -587,6 +594,8 @@ int main(int ac, char **av)
        case listnewconfig:
        case helpnewconfig:
        case olddefconfig:
+       case yes2modconfig:
+       case mod2yesconfig:
                conf_read(NULL);
                break;
        case allnoconfig:
@@ -660,6 +669,12 @@ int main(int ac, char **av)
                break;
        case savedefconfig:
                break;
+       case yes2modconfig:
+               conf_rewrite_mod_or_yes(def_y2m);
+               break;
+       case mod2yesconfig:
+               conf_rewrite_mod_or_yes(def_m2y);
+               break;
        case oldaskconfig:
                rootEntry = &rootmenu;
                conf(&rootmenu);