From 53c5baa3cde9390b7bfd9fff6aa554f4e9c06e1c Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Wed, 15 Feb 2023 16:37:21 +0800 Subject: [PATCH] ASoC: rk817: 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: I97cd09aa0886e2b89f2c2f257defb228168e93b0 --- sound/soc/codecs/rk817_codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/rk817_codec.c b/sound/soc/codecs/rk817_codec.c index 358ec3787bf7..bbd561d1dbe6 100644 --- a/sound/soc/codecs/rk817_codec.c +++ b/sound/soc/codecs/rk817_codec.c @@ -892,8 +892,7 @@ static int rk817_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 rk817_codec_priv *rk817 = snd_soc_component_get_drvdata(component); unsigned int rate = params_rate(params); unsigned char apll_cfg3_val;