]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: hda/senary: Fix beep error handling and optimize EAPD switching
authorwangdicheng <wangdicheng@kylinos.cn>
Tue, 10 Mar 2026 02:36:49 +0000 (10:36 +0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 10 Mar 2026 08:34:41 +0000 (09:34 +0100)
commitedf04f1af05d714c7aba0cf008ded1245365fcd7
tree47f4b84c30fc2a89844248808162d5e3556cc3a3
parentc4791ce96b88a444b04c7089ae2827a3b3ae1877
ALSA: hda/senary: Fix beep error handling and optimize EAPD switching

This patch addresses a potential state inconsistency bug and optimizes
runtime performance:

1. Fix error handling in set_beep_amp():
   Previously, beep_nid was assigned before adding kcontrols. If
   kcontrol creation failed, the function returned error but left
   beep_nid set, causing inconsistent driver state. Moved the
   assignment to the end of the function.

2. Optimize senary_auto_turn_eapd():
   Removed the redundant snd_hda_query_pin_caps() check inside the
   loop. The target pins are sourced from spec->eapds, which is
   strictly filtered during the initial parse phase. Checking
   capabilities again during every mute/unmute hook is unnecessary
   overhead.

Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
Link: https://patch.msgid.link/20260310023649.155858-1-wangdich9700@163.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/hda/codecs/senarytech.c