@@ -40,7 +40,7 @@ static const struct snd_pcm_hardware mt8186_afe_hardware = {
4040static int mt8186_fe_startup (struct snd_pcm_substream * substream ,
4141 struct snd_soc_dai * dai )
4242{
43- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
43+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
4444 struct mtk_base_afe * afe = snd_soc_dai_get_drvdata (dai );
4545 struct snd_pcm_runtime * runtime = substream -> runtime ;
4646 int id = snd_soc_rtd_to_cpu (rtd , 0 )-> id ;
@@ -82,7 +82,7 @@ static int mt8186_fe_startup(struct snd_pcm_substream *substream,
8282static void mt8186_fe_shutdown (struct snd_pcm_substream * substream ,
8383 struct snd_soc_dai * dai )
8484{
85- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
85+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
8686 struct mtk_base_afe * afe = snd_soc_dai_get_drvdata (dai );
8787 struct mt8186_afe_private * afe_priv = afe -> platform_priv ;
8888 int id = snd_soc_rtd_to_cpu (rtd , 0 )-> id ;
@@ -104,7 +104,7 @@ static int mt8186_fe_hw_params(struct snd_pcm_substream *substream,
104104 struct snd_pcm_hw_params * params ,
105105 struct snd_soc_dai * dai )
106106{
107- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
107+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
108108 struct mtk_base_afe * afe = snd_soc_dai_get_drvdata (dai );
109109 int id = snd_soc_rtd_to_cpu (rtd , 0 )-> id ;
110110 unsigned int channels = params_channels (params );
@@ -153,7 +153,7 @@ static int mt8186_fe_hw_free(struct snd_pcm_substream *substream,
153153static int mt8186_fe_trigger (struct snd_pcm_substream * substream , int cmd ,
154154 struct snd_soc_dai * dai )
155155{
156- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
156+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
157157 struct snd_pcm_runtime * const runtime = substream -> runtime ;
158158 struct mtk_base_afe * afe = snd_soc_dai_get_drvdata (dai );
159159 struct mt8186_afe_private * afe_priv = afe -> platform_priv ;
@@ -252,7 +252,7 @@ static int mt8186_fe_trigger(struct snd_pcm_substream *substream, int cmd,
252252static int mt8186_memif_fs (struct snd_pcm_substream * substream ,
253253 unsigned int rate )
254254{
255- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
255+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
256256 struct snd_soc_component * component =
257257 snd_soc_rtdcom_lookup (rtd , AFE_PCM_NAME );
258258 struct mtk_base_afe * afe = snd_soc_component_get_drvdata (component );
@@ -269,7 +269,7 @@ static int mt8186_get_dai_fs(struct mtk_base_afe *afe,
269269
270270static int mt8186_irq_fs (struct snd_pcm_substream * substream , unsigned int rate )
271271{
272- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
272+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
273273 struct snd_soc_component * component =
274274 snd_soc_rtdcom_lookup (rtd , AFE_PCM_NAME );
275275 struct mtk_base_afe * afe = snd_soc_component_get_drvdata (component );
@@ -290,7 +290,7 @@ static int mt8186_get_memif_pbuf_size(struct snd_pcm_substream *substream)
290290static int mt8186_fe_prepare (struct snd_pcm_substream * substream ,
291291 struct snd_soc_dai * dai )
292292{
293- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
293+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
294294 struct snd_pcm_runtime * const runtime = substream -> runtime ;
295295 struct mtk_base_afe * afe = snd_soc_dai_get_drvdata (dai );
296296 int id = snd_soc_rtd_to_cpu (rtd , 0 )-> id ;
0 commit comments