aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-pcm.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 23c251a6c587..09fed7014ed8 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2630,6 +2630,17 @@ static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
2630 return ret; 2630 return ret;
2631} 2631}
2632 2632
2633static void soc_pcm_private_free(struct snd_pcm *pcm)
2634{
2635 struct snd_soc_pcm_runtime *rtd = pcm->private_data;
2636 struct snd_soc_platform *platform = rtd->platform;
2637
2638 /* need to sync the delayed work before releasing resources */
2639 flush_delayed_work(&rtd->delayed_work);
2640 if (platform->driver->pcm_free)
2641 platform->driver->pcm_free(pcm);
2642}
2643
2633/* create a new pcm */ 2644/* create a new pcm */
2634int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) 2645int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
2635{ 2646{
@@ -2755,7 +2766,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
2755 } 2766 }
2756 } 2767 }
2757 2768
2758 pcm->private_free = platform->driver->pcm_free; 2769 pcm->private_free = soc_pcm_private_free;
2759out: 2770out:
2760 dev_info(rtd->card->dev, "%s <-> %s mapping ok\n", 2771 dev_info(rtd->card->dev, "%s <-> %s mapping ok\n",
2761 (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name, 2772 (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name,