ASoC: renesas: rz-ssi: Ensure the component is marked as opened on success

snd_pcm_hw_constraint_integer() may return 1, which is then returned
from rz_ssi_pcm_open_xx(). ASoC only marks the component as opened when
.open() returns 0.

This currently has no functional impact, as the component driver has no
.close() callback. Still, return 0 explicitly on success to match what
ASoC expects and ensure the component is correctly marked as opened.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://patch.msgid.link/20261008103831.542533-23-phucduc.bui@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
bui duc phuc 2026-10-08 17:38:29 +07:00 committed by Mark Brown
parent b7c58a55fd
commit fd5c45166d
No known key found for this signature in database
GPG Key ID: 2FEF73B0B3D03889

View File

@ -937,17 +937,29 @@ static const struct snd_pcm_hardware rz_ssi_pcm_hardware = {
static int rz_ssi_pcm_open_pio(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
int ret;
snd_soc_set_runtime_hwparams(substream, &rz_ssi_pcm_hardware);
return snd_pcm_hw_constraint_integer(substream->runtime,
ret = snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0)
return ret;
return 0;
}
static int rz_ssi_pcm_open_dma(struct snd_soc_component *component,
struct snd_pcm_substream *substream)
{
return snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
int ret;
ret = snd_pcm_hw_constraint_integer(substream->runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0)
return ret;
return 0;
}
static snd_pcm_uframes_t rz_ssi_pcm_pointer(struct snd_soc_component *component,