From 150af0ebb0d9dc900f20b984ca9dffee87410207 Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Wed, 15 Feb 2023 16:31:23 +0800 Subject: [PATCH] ASoC: rk312x: Fix wrong component assignment Should use dai->component instead of the fixed rtd->codec[0], because codec may be addressed in multi-codecs situation, Obviously, it's wrong. the dais' one is always RIGHT. Signed-off-by: Sugar Zhang Change-Id: I4d95b82e36a929e46f4992cbb198b6a060c5c939 --- sound/soc/codecs/rk312x_codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/rk312x_codec.c b/sound/soc/codecs/rk312x_codec.c index 0e3ac4008962..aba53c198407 100644 --- a/sound/soc/codecs/rk312x_codec.c +++ b/sound/soc/codecs/rk312x_codec.c @@ -1424,8 +1424,7 @@ static int rk312x_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; + struct snd_soc_component *component = dai->component; struct rk312x_codec_priv *rk312x = rk312x_priv; unsigned int rate = params_rate(params); unsigned int div;