Re: [PATCH] ALSA: hda/senary: Fix beep error handling and optimize EAPD switching
From: Takashi Iwai
Date: Tue Mar 10 2026 - 04:35:36 EST
On Tue, 10 Mar 2026 03:36:49 +0100,
wangdich9700@xxxxxxx wrote:
>
> From: wangdicheng <wangdicheng@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
Applied to for-next branch now. Thanks.
Takashi