ALSA: hda - Fix bogus codec address check for mixer name assignment
The recent commit [7fbe824a0f
: ALSA: hda - Update mixer name for the lower codec address] tried to improve the mixer chip name assignment in the order of codec address. However, this fix was utterly bogus; it checks the field set in each codec, thus this value is reset at each codec creation, of course. For really handling this priority, the assignment has to be remembered in the common place, namely in hda_bus, instead of hda_codec. Fixes:7fbe824a0f
('ALSA: hda - Update mixer name for the lower codec address') Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
@@ -62,11 +62,11 @@ int snd_hda_codec_set_name(struct hda_codec *codec, const char *name)
|
||||
|
||||
/* update the mixer name */
|
||||
if (!*codec->card->mixername ||
|
||||
codec->mixer_assigned >= codec->core.addr) {
|
||||
codec->bus->mixer_assigned >= codec->core.addr) {
|
||||
snprintf(codec->card->mixername,
|
||||
sizeof(codec->card->mixername), "%s %s",
|
||||
codec->core.vendor_name, codec->core.chip_name);
|
||||
codec->mixer_assigned = codec->core.addr;
|
||||
codec->bus->mixer_assigned = codec->core.addr;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user