Merge remote-tracking branches 'asoc/fix/compress', 'asoc/fix/core', 'asoc/fix/dapm...
authorMark Brown <broonie@kernel.org>
Wed, 7 Feb 2018 11:21:02 +0000 (11:21 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 7 Feb 2018 11:21:02 +0000 (11:21 +0000)
sound/soc/mediatek/mt8173/mt8173-rt5650.c
sound/soc/soc-compress.c
sound/soc/soc-dapm.c
sound/soc/soc-pcm.c

index 40ebefd625c1e4370e1f6527e3003b03fac4d34d..679fc8bea0a32fdff72dcef61673f42d401d3dd6 100644 (file)
@@ -272,15 +272,10 @@ static int mt8173_rt5650_dev_probe(struct platform_device *pdev)
        }
        mt8173_rt5650_codecs[1].of_node = mt8173_rt5650_codecs[0].of_node;
 
-       if (of_find_node_by_name(platform_node, "codec-capture")) {
-               np = of_get_child_by_name(pdev->dev.of_node, "codec-capture");
-               if (!np) {
-                       dev_err(&pdev->dev,
-                               "%s: Can't find codec-capture DT node\n",
-                               __func__);
-                       return -EINVAL;
-               }
+       np = of_get_child_by_name(pdev->dev.of_node, "codec-capture");
+       if (np) {
                ret = snd_soc_of_get_dai_name(np, &codec_capture_dai);
+               of_node_put(np);
                if (ret < 0) {
                        dev_err(&pdev->dev,
                                "%s codec_capture_dai name fail %d\n",
index 81232f4ab614b3089fe1af42a5612f3a1cbd8fea..7973f92cd40f53ab756944dd2a45ab8bfe5421e4 100644 (file)
@@ -944,7 +944,7 @@ static int soc_compr_copy(struct snd_compr_stream *cstream,
        struct snd_soc_platform *platform = rtd->platform;
        struct snd_soc_component *component;
        struct snd_soc_rtdcom_list *rtdcom;
-       int ret = 0, __ret;
+       int ret = 0;
 
        mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass);
 
@@ -965,10 +965,10 @@ static int soc_compr_copy(struct snd_compr_stream *cstream,
                    !component->driver->compr_ops->copy)
                        continue;
 
-               __ret = component->driver->compr_ops->copy(cstream, buf, count);
-               if (__ret < 0)
-                       ret = __ret;
+               ret = component->driver->compr_ops->copy(cstream, buf, count);
+               break;
        }
+
 err:
        mutex_unlock(&rtd->pcm_mutex);
        return ret;
index a10b21cfc31ed2e5e6bafcc991682d9861fcfb4e..ee6d9d9a3c5eb9260dfcdf4f94de3f587c409751 100644 (file)
@@ -2026,7 +2026,7 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
        snd_soc_dapm_for_each_direction(dir) {
                rdir = SND_SOC_DAPM_DIR_REVERSE(dir);
                snd_soc_dapm_widget_for_each_path(w, dir, p) {
-                       if (p->connected && !p->connected(w, p->node[rdir]))
+                       if (p->connected && !p->connected(p->source, p->sink))
                                continue;
 
                        if (!p->connect)
index 8075856668c23b10e0f16eebb78cb59b8c7a233a..998800cc44ef9ad39aa9e6ca8a01584daa5228e6 100644 (file)
@@ -2831,10 +2831,9 @@ static void soc_pcm_private_free(struct snd_pcm *pcm)
        struct snd_soc_rtdcom_list *rtdcom;
        struct snd_soc_component *component;
 
+       /* need to sync the delayed work before releasing resources */
+       flush_delayed_work(&rtd->delayed_work);
        for_each_rtdcom(rtd, rtdcom) {
-               /* need to sync the delayed work before releasing resources */
-
-               flush_delayed_work(&rtd->delayed_work);
                component = rtdcom->component;
 
                if (component->pcm_free)