Merge branch 'mailbox-for-next' of git://git.linaro.org/landing-teams/working/fujitsu...
[deliverable/linux.git] / sound / soc / soc-pcm.c
index 256b9c91aa94316979a270aa7459c83a0659b5da..70e4b9d8bdcdfd3fb83f37615a29fae64036d4c0 100644 (file)
@@ -1231,24 +1231,17 @@ static int widget_in_list(struct snd_soc_dapm_widget_list *list,
 }
 
 int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
-       int stream, struct snd_soc_dapm_widget_list **list_)
+       int stream, struct snd_soc_dapm_widget_list **list)
 {
        struct snd_soc_dai *cpu_dai = fe->cpu_dai;
-       struct snd_soc_dapm_widget_list *list;
        int paths;
 
-       list = kzalloc(sizeof(struct snd_soc_dapm_widget_list) +
-                       sizeof(struct snd_soc_dapm_widget *), GFP_KERNEL);
-       if (list == NULL)
-               return -ENOMEM;
-
        /* get number of valid DAI paths and their widgets */
-       paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, &list);
+       paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, list);
 
        dev_dbg(fe->dev, "ASoC: found %d audio %s paths\n", paths,
                        stream ? "capture" : "playback");
 
-       *list_ = list;
        return paths;
 }
 
@@ -1306,7 +1299,12 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
 
                switch (list->widgets[i]->id) {
                case snd_soc_dapm_dai_in:
+                       if (stream != SNDRV_PCM_STREAM_PLAYBACK)
+                               continue;
+                       break;
                case snd_soc_dapm_dai_out:
+                       if (stream != SNDRV_PCM_STREAM_CAPTURE)
+                               continue;
                        break;
                default:
                        continue;
This page took 0.126264 seconds and 5 git commands to generate.