kconfig: Add yes2modconfig and mod2yesconfig targets.
[carl9170fw.git] / config / confdata.c
index cc18bc408397812ea125d1009da576a3cd897ec7..5d0ac58afa860f7e07d10b0734e272291239c5a6 100644 (file)
@@ -1389,3 +1389,19 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode)
 
        return has_changed;
 }
+
+void conf_rewrite_mod_or_yes(enum conf_def_mode mode)
+{
+       struct symbol *sym;
+       int i;
+       tristate old_val = (mode == def_y2m) ? yes : mod;
+       tristate new_val = (mode == def_y2m) ? mod : yes;
+
+       for_all_symbols(i, sym) {
+               if (sym_get_type(sym) == S_TRISTATE &&
+                   sym->def[S_DEF_USER].tri == old_val) {
+                       sym->def[S_DEF_USER].tri = new_val;
+                       sym_add_change_count(1);
+               }
+       }
+}