x86, tsc: Fix cpufreq lockup
[platform/adaptation/renesas_rcar/renesas_kernel.git] / sound / soc / soc-dapm.c
index b9dc6ac..731d47b 100644 (file)
@@ -251,7 +251,6 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
 static void dapm_kcontrol_free(struct snd_kcontrol *kctl)
 {
        struct dapm_kcontrol_data *data = snd_kcontrol_chip(kctl);
-       kfree(data->widget);
        kfree(data->wlist);
        kfree(data);
 }
@@ -2889,22 +2888,19 @@ int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol,
        mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
 
        change = dapm_kcontrol_set_value(kcontrol, val);
-
-       if (reg != SND_SOC_NOPM) {
-               mask = mask << shift;
-               val = val << shift;
-
-               change = snd_soc_test_bits(codec, reg, mask, val);
-       }
-
        if (change) {
                if (reg != SND_SOC_NOPM) {
-                       update.kcontrol = kcontrol;
-                       update.reg = reg;
-                       update.mask = mask;
-                       update.val = val;
+                       mask = mask << shift;
+                       val = val << shift;
+
+                       if (snd_soc_test_bits(codec, reg, mask, val)) {
+                               update.kcontrol = kcontrol;
+                               update.reg = reg;
+                               update.mask = mask;
+                               update.val = val;
+                               card->update = &update;
+                       }
 
-                       card->update = &update;
                }
 
                ret = soc_dapm_mixer_update_power(card, kcontrol, connect);
@@ -3650,8 +3646,11 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
                cpu_dai = rtd->cpu_dai;
                codec_dai = rtd->codec_dai;
 
-               /* dynamic FE links have no fixed DAI mapping */
-               if (rtd->dai_link->dynamic)
+               /*
+                * dynamic FE links have no fixed DAI mapping.
+                * CODEC<->CODEC links have no direct connection.
+                */
+               if (rtd->dai_link->dynamic || rtd->dai_link->params)
                        continue;
 
                /* there is no point in connecting BE DAI links with dummies */