···3434bool sym_string_within_range(struct symbol *sym, const char *str);3535bool sym_set_string_value(struct symbol *sym, const char *newval);3636bool sym_is_changeable(const struct symbol *sym);3737+struct menu *sym_get_prompt_menu(const struct symbol *sym);3738struct menu *sym_get_choice_menu(const struct symbol *sym);3839const char * sym_get_string_value(struct symbol *sym);3940
+19-7
scripts/kconfig/symbol.c
···7171}72727373/**7474+ * sym_get_prompt_menu - get the menu entry with a prompt7575+ *7676+ * @sym: a symbol pointer7777+ *7878+ * Return: the menu entry with a prompt.7979+ */8080+struct menu *sym_get_prompt_menu(const struct symbol *sym)8181+{8282+ struct menu *m;8383+8484+ list_for_each_entry(m, &sym->menus, link)8585+ if (m->prompt)8686+ return m;8787+8888+ return NULL;8989+}9090+9191+/**7492 * sym_get_choice_menu - get the parent choice menu if present7593 *7694 * @sym: a symbol pointer···9880struct menu *sym_get_choice_menu(const struct symbol *sym)9981{10082 struct menu *menu = NULL;101101- struct menu *m;1028310384 /*10485 * Choice members must have a prompt. Find a menu entry with a prompt,10586 * and assume it resides inside a choice block.10687 */107107- list_for_each_entry(m, &sym->menus, link)108108- if (m->prompt) {109109- menu = m;110110- break;111111- }112112-8888+ menu = sym_get_prompt_menu(sym);11389 if (!menu)11490 return NULL;11591