Merge branch 'fix/pcm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound...
authorMark Brown <broonie@kernel.org>
Wed, 27 Sep 2017 17:11:06 +0000 (10:11 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 27 Sep 2017 17:11:06 +0000 (10:11 -0700)
sound/soc/soc-pcm.c

index 23c251a6c5875cfd884b4f57b4e2afb1da0ed0cc..09fed7014ed84e8955256aa4a0241ce5d2919ef6 100644 (file)
@@ -2630,6 +2630,17 @@ static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
        return ret;
 }
 
+static void soc_pcm_private_free(struct snd_pcm *pcm)
+{
+       struct snd_soc_pcm_runtime *rtd = pcm->private_data;
+       struct snd_soc_platform *platform = rtd->platform;
+
+       /* need to sync the delayed work before releasing resources */
+       flush_delayed_work(&rtd->delayed_work);
+       if (platform->driver->pcm_free)
+               platform->driver->pcm_free(pcm);
+}
+
 /* create a new pcm */
 int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
 {
@@ -2755,7 +2766,7 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)
                }
        }
 
-       pcm->private_free = platform->driver->pcm_free;
+       pcm->private_free = soc_pcm_private_free;
 out:
        dev_info(rtd->card->dev, "%s <-> %s mapping ok\n",
                 (rtd->num_codecs > 1) ? "multicodec" : rtd->codec_dai->name,