@@ -205,7 +205,7 @@ static int sc7280_snd_hw_params(struct snd_pcm_substream *substream,
205205 struct snd_pcm_hw_params * params )
206206{
207207 struct snd_pcm_runtime * runtime = substream -> runtime ;
208- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
208+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
209209 struct snd_soc_dai * codec_dai ;
210210 const struct snd_soc_dai * cpu_dai = snd_soc_rtd_to_cpu (rtd , 0 );
211211 struct sc7280_snd_data * pdata = snd_soc_card_get_drvdata (rtd -> card );
@@ -237,7 +237,7 @@ static int sc7280_snd_hw_params(struct snd_pcm_substream *substream,
237237
238238static int sc7280_snd_swr_prepare (struct snd_pcm_substream * substream )
239239{
240- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
240+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
241241 const struct snd_soc_dai * cpu_dai = snd_soc_rtd_to_cpu (rtd , 0 );
242242 struct sc7280_snd_data * data = snd_soc_card_get_drvdata (rtd -> card );
243243 struct sdw_stream_runtime * sruntime = data -> sruntime [cpu_dai -> id ];
@@ -268,7 +268,7 @@ static int sc7280_snd_swr_prepare(struct snd_pcm_substream *substream)
268268
269269static int sc7280_snd_prepare (struct snd_pcm_substream * substream )
270270{
271- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
271+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
272272 const struct snd_soc_dai * cpu_dai = snd_soc_rtd_to_cpu (rtd , 0 );
273273
274274 switch (cpu_dai -> id ) {
@@ -287,7 +287,7 @@ static int sc7280_snd_prepare(struct snd_pcm_substream *substream)
287287
288288static int sc7280_snd_hw_free (struct snd_pcm_substream * substream )
289289{
290- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
290+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
291291 struct sc7280_snd_data * data = snd_soc_card_get_drvdata (rtd -> card );
292292 const struct snd_soc_dai * cpu_dai = snd_soc_rtd_to_cpu (rtd , 0 );
293293 struct sdw_stream_runtime * sruntime = data -> sruntime [cpu_dai -> id ];
@@ -312,7 +312,7 @@ static int sc7280_snd_hw_free(struct snd_pcm_substream *substream)
312312
313313static void sc7280_snd_shutdown (struct snd_pcm_substream * substream )
314314{
315- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
315+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
316316 struct snd_soc_card * card = rtd -> card ;
317317 struct sc7280_snd_data * data = snd_soc_card_get_drvdata (card );
318318 struct snd_soc_dai * cpu_dai = snd_soc_rtd_to_cpu (rtd , 0 );
@@ -339,7 +339,7 @@ static int sc7280_snd_startup(struct snd_pcm_substream *substream)
339339{
340340 unsigned int fmt = SND_SOC_DAIFMT_CBS_CFS ;
341341 unsigned int codec_dai_fmt = SND_SOC_DAIFMT_CBS_CFS ;
342- struct snd_soc_pcm_runtime * rtd = substream -> private_data ;
342+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd ( substream ) ;
343343 struct snd_soc_dai * cpu_dai = snd_soc_rtd_to_cpu (rtd , 0 );
344344 struct snd_soc_dai * codec_dai = snd_soc_rtd_to_codec (rtd , 0 );
345345 int ret = 0 ;
0 commit comments