Merge tag 'sound-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[sfrench/cifs-2.6.git] / sound / soc / soc-compress.c
index 246a5e32e22a2937d0f084966dcf2ea6e4c44ad2..b4f59350a5a8a6dbd25077177cb41e304ed0eb54 100644 (file)
@@ -115,9 +115,7 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
        ret = dpcm_path_get(fe, stream, &list);
        if (ret < 0)
                goto be_err;
        ret = dpcm_path_get(fe, stream, &list);
        if (ret < 0)
                goto be_err;
-       else if (ret == 0)
-               dev_dbg(fe->dev, "Compress ASoC: %s no valid %s route\n",
-                       fe->dai_link->name, stream ? "capture" : "playback");
+
        /* calculate valid and active FE <-> BE dpcms */
        dpcm_process_paths(fe, stream, &list, 1);
        fe->dpcm[stream].runtime = fe_substream->runtime;
        /* calculate valid and active FE <-> BE dpcms */
        dpcm_process_paths(fe, stream, &list, 1);
        fe->dpcm[stream].runtime = fe_substream->runtime;
@@ -153,7 +151,9 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
        fe->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN;
        fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
 
        fe->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN;
        fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO;
 
+       mutex_lock_nested(&fe->card->pcm_mutex, fe->card->pcm_subclass);
        snd_soc_runtime_activate(fe, stream);
        snd_soc_runtime_activate(fe, stream);
+       mutex_unlock(&fe->card->pcm_mutex);
 
        mutex_unlock(&fe->card->mutex);
 
 
        mutex_unlock(&fe->card->mutex);
 
@@ -177,19 +177,18 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream)
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(fe, 0);
        struct snd_soc_dpcm *dpcm;
        int stream = cstream->direction; /* SND_COMPRESS_xxx is same as SNDRV_PCM_STREAM_xxx */
        struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(fe, 0);
        struct snd_soc_dpcm *dpcm;
        int stream = cstream->direction; /* SND_COMPRESS_xxx is same as SNDRV_PCM_STREAM_xxx */
-       int ret;
 
        mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
 
 
        mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME);
 
+       mutex_lock_nested(&fe->card->pcm_mutex, fe->card->pcm_subclass);
        snd_soc_runtime_deactivate(fe, stream);
        snd_soc_runtime_deactivate(fe, stream);
+       mutex_unlock(&fe->card->pcm_mutex);
 
        fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
 
 
        fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE;
 
-       ret = dpcm_be_dai_hw_free(fe, stream);
-       if (ret < 0)
-               dev_err(fe->dev, "Compressed ASoC: hw_free failed: %d\n", ret);
+       dpcm_be_dai_hw_free(fe, stream);
 
 
-       ret = dpcm_be_dai_shutdown(fe, stream);
+       dpcm_be_dai_shutdown(fe, stream);
 
        /* mark FE's links ready to prune */
        for_each_dpcm_be(fe, stream, dpcm)
 
        /* mark FE's links ready to prune */
        for_each_dpcm_be(fe, stream, dpcm)