Re: [PATCH] ALSA: hda: cs35l56: Fix mixed cleanup and goto in cs35l56_hda_fw_load()

From: Takashi Iwai

Date: Wed Nov 04 2026 - 09:46:01 EST


On Wed, 04 Nov 2026 12:11:21 +0100,
Richard Fitzgerald wrote:
>
> Remove the gotos from cs35l56_hda_fw_load() to prevent mixing
> auto-cleanup and goto-cleanup in the same function. Replace them with
> returns and remove the goto cleanup code, as there's no need to "undo"
> a cs_dsp_power_up() with a cs_dsp_power_down() here.
>
> Two previous commits added auto-cleanup to cs35l56_hda_fw_load() but
> didn't remove the goto, which leaves mixed cleanup and goto.
>
> commit 0ff22680e51f4 ("ALSA: hda/cs35l56: Clean up with
> PM_RUNTIME_ACQUIRE*() macros")
>
> commit 185841c94accc ("ALSA: hda: cs35l56: Use auto-cleanup for firmware
> loading")
>
> There's actually no need to call cs_dsp_power_down() here. On the
> CS35L54/56/57 amps it doesn't control the DSP subsystem power (that is all
> managed by the firmware), so it's perfectly safe to just return if there
> are any errors after a successful cs_dsp_power_up(). As cs_dsp_power_up()
> was successful it is valid to leave cs_dsp in this state, which matches
> the state of the hardware.
>
> The two places that cs_dsp_power_down() is called conditionally have been
> changed to check the cs_dsp.booted flag, now the fw_patched flag is not
> a guaranteed proxy. The booted flag is directly indicating that there has
> been a successful cs_dsp_power_up() so this is more correct anyway.
>
> Fixes: 0ff22680e51f4 ("ALSA: hda/cs35l56: Clean up with PM_RUNTIME_ACQUIRE*() macros")
> Signed-off-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>

Applied now. Thanks.


Takashi