kconfig: fix missing choice values in auto.conf
[carl9170fw.git] / config / confdata.c
index ab42aa650794e4f1a4bdc15ef65f23f404ad3b83..b81ebe64b2b44705685253dbd65bdeb0e7869aef 100644 (file)
@@ -941,7 +941,8 @@ int conf_write(const char *name)
                                     "# %s\n"
                                     "#\n", str);
                        need_newline = false;
-               } else if (!(sym->flags & SYMBOL_CHOICE)) {
+               } else if (!(sym->flags & SYMBOL_CHOICE) &&
+                          !(sym->flags & SYMBOL_WRITTEN)) {
                        sym_calc_value(sym);
                        if (!(sym->flags & SYMBOL_WRITE))
                                goto next;
@@ -949,7 +950,7 @@ int conf_write(const char *name)
                                fprintf(out, "\n");
                                need_newline = false;
                        }
-                       sym->flags &= ~SYMBOL_WRITE;
+                       sym->flags |= SYMBOL_WRITTEN;
                        conf_write_symbol(out, sym, &kconfig_printer_cb, NULL);
                }
 
@@ -1109,8 +1110,6 @@ int conf_write_autoconf(int overwrite)
        if (!overwrite && is_present(autoconf_name))
                return 0;
 
-       sym_clear_all_valid();
-
        conf_write_dep("include/generated/auto.conf.cmd");
 
        if (conf_touch_deps())