diff --git a/sound/hda/codecs/generic.c b/sound/hda/codecs/generic.c index 660a9f2c0ded..9f6f44cdbe1e 100644 --- a/sound/hda/codecs/generic.c +++ b/sound/hda/codecs/generic.c @@ -2695,30 +2695,13 @@ static const struct snd_kcontrol_new out_jack_mode_enum = { .put = out_jack_mode_put, }; -static bool find_kctl_name(struct hda_codec *codec, const char *name, int idx) -{ - struct hda_gen_spec *spec = codec->spec; - const struct snd_kcontrol_new *kctl; - int i; - - snd_array_for_each(&spec->kctls, i, kctl) { - if (!strcmp(kctl->name, name) && kctl->index == idx) - return true; - } - return false; -} - static void get_jack_mode_name(struct hda_codec *codec, hda_nid_t pin, char *name, size_t name_len) { struct hda_gen_spec *spec = codec->spec; - int idx = 0; - snd_hda_get_pin_label(codec, pin, &spec->autocfg, name, name_len, &idx); + snd_hda_get_pin_label(codec, pin, &spec->autocfg, name, name_len, NULL); strlcat(name, " Jack Mode", name_len); - - for (; find_kctl_name(codec, name, idx); idx++) - ; } static int get_out_jack_num_items(struct hda_codec *codec, hda_nid_t pin)