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 <sugar.zhang@rock-chips.com>
Change-Id: I4d95b82e36a929e46f4992cbb198b6a060c5c939
This commit is contained in:
Sugar Zhang
2023-02-15 16:31:23 +08:00
committed by Tao Huang
parent 146f0f25ff
commit 150af0ebb0

View File

@@ -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;