diff options
| author | Takashi Iwai <tiwai@suse.de> | 2026-07-30 10:44:32 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-07-30 17:46:38 +0200 |
| commit | 6993ae546defd80467309695fce9ae4a1bcfefbe (patch) | |
| tree | 98ea4dfee252ea02889e1ee476037df1ad7207c7 | |
| parent | ffd02a377a442c960bfc2151eaf7f8c04a5ea0ee (diff) | |
| download | linux-next-6993ae546defd80467309695fce9ae4a1bcfefbe.tar.gz linux-next-6993ae546defd80467309695fce9ae4a1bcfefbe.zip | |
ALSA: hda: Drop unneeded calculation of index at get_jack_mode_name()
get_jack_mode_name() tries to identify the (potential) index number of
the control element to be created, but this index number isn't
actually used, since the index is set automatically at instantiating
the controls.
Drop the unneeded index retrieval and calculation as a cleanup.
Along with the change, find_kctl_name() is no longer used, hence drop
this function as well.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260730084513.327992-2-tiwai@suse.de
| -rw-r--r-- | sound/hda/codecs/generic.c | 19 |
1 files changed, 1 insertions, 18 deletions
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) |
