Re: [PATCH 2/4] ASoC: mediatek: mt8188: return 0 from mt8188_afe_fe_startup() on success

From: Cezary Rojewski

Date: Tue Oct 06 2026 - 06:43:39 EST


On 10/6/2026 12:16 PM, phucduc.bui@xxxxxxxxx wrote:

> --- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
> @@ -318,8 +318,11 @@ static int mt8188_afe_fe_startup(struct snd_pcm_substream *substream,
> ret = snd_pcm_hw_constraint_minmax(runtime,
> SNDRV_PCM_HW_PARAM_PERIOD_SIZE, 1,
> MT8188_MEMIF_DL7_MAX_PERIOD_SIZE);
> - if (ret < 0)
> + if (ret >= 0)
> + ret = 0;
> + else
> dev_dbg(afe->dev, "hw_constraint_minmax failed\n");


You can reduce the delta by leaving the original if-statement as-is and
following it up with:

else
ret = 0;

> +
> out:
> return ret;
> }