Re: [PATCH 06/14] ASoC: mediatek: mt8195: Fix FE startup error handling
From: Bui Duc Phuc
Date: Mon Oct 05 2026 - 03:18:29 EST
Hi Mark,
Thank you for your review.
> > + ret = snd_pcm_hw_constraint_step(runtime, 0,
> > + SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
> > + MT8195_MEMIF_BUFFER_BYTES_ALIGN);
> > + if (ret)
> > + goto err_fe_shutdow;
>
> This will return 1 if a new constraint is installed which is not a
> failure.
Do you mean snd_pcm_hw_constraint_integer() rather than
snd_pcm_hw_constraint_step()?
snd_pcm_hw_constraint_step() returns zero on success or a negative
error code on failure,
so it does not return 1 when a new constraint is installed.
snd_pcm_hw_constraint_integer() is also called from
mtk_afe_fe_startup(), and it can
return a positive value when the interval is changed, zero when it is
unchanged,
or a negative error code on failure.
I will change the caller to check for a negative return value:
-------------------------------------------------------
ret = mtk_afe_fe_startup(substream, dai);
if (ret < 0)
goto err_clk_unprepare;
-------------------------------------------------------
Best regards,
Phuc