ASoC: Merge fixes
[sfrench/cifs-2.6.git] / sound / soc / soc-pcm.c
index 7958c9defd4922fe8a337008f09ae00e0ff9b8ae..b830a53ceacbb8f1ec4173aa4b04bb82c8a6d80f 100644 (file)
@@ -1230,7 +1230,6 @@ static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe,
 
        dpcm->be = be;
        dpcm->fe = fe;
-       be->dpcm[stream].runtime = fe->dpcm[stream].runtime;
        dpcm->state = SND_SOC_DPCM_LINK_STATE_NEW;
        snd_soc_dpcm_stream_lock_irq(fe, stream);
        list_add(&dpcm->list_be, &fe->dpcm[stream].be_clients);
@@ -1465,10 +1464,11 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
        struct snd_soc_dapm_widget_list *list = *list_;
        struct snd_soc_pcm_runtime *be;
        struct snd_soc_dapm_widget *widget;
+       struct snd_pcm_substream *fe_substream = snd_soc_dpcm_get_substream(fe, stream);
        int i, new = 0, err;
 
        /* don't connect if FE is not running */
-       if (!fe->dpcm[stream].runtime && !fe->fe_compr)
+       if (!fe_substream->runtime && !fe->fe_compr)
                return new;
 
        /* Create any new FE <--> BE connections */
@@ -1590,6 +1590,7 @@ void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream,
 
 int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
 {
+       struct snd_pcm_substream *fe_substream = snd_soc_dpcm_get_substream(fe, stream);
        struct snd_soc_pcm_runtime *be;
        struct snd_soc_dpcm *dpcm;
        int err, count = 0;
@@ -1629,7 +1630,7 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
                dev_dbg(be->dev, "ASoC: open %s BE %s\n",
                        stream ? "capture" : "playback", be->dai_link->name);
 
-               be_substream->runtime = be->dpcm[stream].runtime;
+               be_substream->runtime = fe_substream->runtime;
                err = __soc_pcm_open(be, be_substream);
                if (err < 0) {
                        be->dpcm[stream].users--;
@@ -2697,8 +2698,6 @@ static void dpcm_fe_dai_cleanup(struct snd_pcm_substream *fe_substream)
                dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE;
 
        dpcm_be_disconnect(fe, stream);
-
-       fe->dpcm[stream].runtime = NULL;
 }
 
 static int dpcm_fe_dai_close(struct snd_pcm_substream *fe_substream)
@@ -2723,7 +2722,6 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
        int stream = fe_substream->stream;
 
        snd_soc_dpcm_mutex_lock(fe);
-       fe->dpcm[stream].runtime = fe_substream->runtime;
 
        ret = dpcm_path_get(fe, stream, &list);
        if (ret < 0)