@@ -376,11 +376,12 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
376376static int intel_prepare (struct snd_pcm_substream * substream ,
377377 struct snd_soc_dai * dai )
378378{
379+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd (substream );
379380 struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
380381 struct sdw_intel * sdw = cdns_to_intel (cdns );
381382 struct sdw_cdns_dai_runtime * dai_runtime ;
383+ struct snd_pcm_hw_params * hw_params ;
382384 int ch , dir ;
383- int ret = 0 ;
384385
385386 dai_runtime = cdns -> dai_runtime_array [dai -> id ];
386387 if (!dai_runtime ) {
@@ -389,12 +390,8 @@ static int intel_prepare(struct snd_pcm_substream *substream,
389390 return - EIO ;
390391 }
391392
393+ hw_params = & rtd -> dpcm [substream -> stream ].hw_params ;
392394 if (dai_runtime -> suspended ) {
393- struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd (substream );
394- struct snd_pcm_hw_params * hw_params ;
395-
396- hw_params = & rtd -> dpcm [substream -> stream ].hw_params ;
397-
398395 dai_runtime -> suspended = false;
399396
400397 /*
@@ -415,15 +412,11 @@ static int intel_prepare(struct snd_pcm_substream *substream,
415412 /* the SHIM will be configured in the callback functions */
416413
417414 sdw_cdns_config_stream (cdns , ch , dir , dai_runtime -> pdi );
418-
419- /* Inform DSP about PDI stream number */
420- ret = intel_params_stream (sdw , substream , dai ,
421- hw_params ,
422- sdw -> instance ,
423- dai_runtime -> pdi -> intel_alh_id );
424415 }
425416
426- return ret ;
417+ /* Inform DSP about PDI stream number */
418+ return intel_params_stream (sdw , substream , dai , hw_params , sdw -> instance ,
419+ dai_runtime -> pdi -> intel_alh_id );
427420}
428421
429422static int
0 commit comments