@@ -376,11 +376,12 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
376
376
static int intel_prepare (struct snd_pcm_substream * substream ,
377
377
struct snd_soc_dai * dai )
378
378
{
379
+ struct snd_soc_pcm_runtime * rtd = snd_soc_substream_to_rtd (substream );
379
380
struct sdw_cdns * cdns = snd_soc_dai_get_drvdata (dai );
380
381
struct sdw_intel * sdw = cdns_to_intel (cdns );
381
382
struct sdw_cdns_dai_runtime * dai_runtime ;
383
+ struct snd_pcm_hw_params * hw_params ;
382
384
int ch , dir ;
383
- int ret = 0 ;
384
385
385
386
dai_runtime = cdns -> dai_runtime_array [dai -> id ];
386
387
if (!dai_runtime ) {
@@ -389,12 +390,8 @@ static int intel_prepare(struct snd_pcm_substream *substream,
389
390
return - EIO ;
390
391
}
391
392
393
+ hw_params = & rtd -> dpcm [substream -> stream ].hw_params ;
392
394
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
-
398
395
dai_runtime -> suspended = false;
399
396
400
397
/*
@@ -415,15 +412,11 @@ static int intel_prepare(struct snd_pcm_substream *substream,
415
412
/* the SHIM will be configured in the callback functions */
416
413
417
414
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 );
424
415
}
425
416
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 );
427
420
}
428
421
429
422
static int
0 commit comments