File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,15 @@ static void soc_rtd_shutdown(struct snd_soc_pcm_runtime *rtd,
45
45
rtd -> dai_link -> ops -> shutdown (substream );
46
46
}
47
47
48
+ static int soc_rtd_prepare (struct snd_soc_pcm_runtime * rtd ,
49
+ struct snd_pcm_substream * substream )
50
+ {
51
+ if (rtd -> dai_link -> ops &&
52
+ rtd -> dai_link -> ops -> prepare )
53
+ return rtd -> dai_link -> ops -> prepare (substream );
54
+ return 0 ;
55
+ }
56
+
48
57
/**
49
58
* snd_soc_runtime_activate() - Increment active count for PCM runtime components
50
59
* @rtd: ASoC PCM runtime that is activated
@@ -716,13 +725,11 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
716
725
717
726
mutex_lock_nested (& rtd -> card -> pcm_mutex , rtd -> card -> pcm_subclass );
718
727
719
- if (rtd -> dai_link -> ops -> prepare ) {
720
- ret = rtd -> dai_link -> ops -> prepare (substream );
721
- if (ret < 0 ) {
722
- dev_err (rtd -> card -> dev , "ASoC: machine prepare error:"
723
- " %d\n" , ret );
724
- goto out ;
725
- }
728
+ ret = soc_rtd_prepare (rtd , substream );
729
+ if (ret < 0 ) {
730
+ dev_err (rtd -> card -> dev ,
731
+ "ASoC: machine prepare error: %d\n" , ret );
732
+ goto out ;
726
733
}
727
734
728
735
for_each_rtd_components (rtd , i , component ) {
You can’t perform that action at this time.
0 commit comments