ASoC: soc-core: WARN() is not related to component->driver->probe
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Fri, 17 May 2019 06:06:37 +0000 (15:06 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 20 May 2019 14:21:42 +0000 (15:21 +0100)
soc_probe_component() has WARN() under if (component->driver->probe),
but, this WARN() check is not related to .probe callback.
So, it should be called at (B) instead of (A).
This patch moves it out of if().

if (component->driver->probe) {
ret = component->driver->probe(component);
...
(A) WARN(...)
}
(B) WARN(...)

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c

index e83edbe270419feacf567785e9a50f5f92aaceda..ce8c057bcd5b5e7fe0f5a36ea20d42cc94cfd8d5 100644 (file)
@@ -1420,12 +1420,11 @@ static int soc_probe_component(struct snd_soc_card *card,
                                "ASoC: failed to probe component %d\n", ret);
                        goto err_probe;
                }
-
-               WARN(dapm->idle_bias_off &&
-                       dapm->bias_level != SND_SOC_BIAS_OFF,
-                       "codec %s can not start from non-off bias with idle_bias_off==1\n",
-                       component->name);
        }
+       WARN(dapm->idle_bias_off &&
+            dapm->bias_level != SND_SOC_BIAS_OFF,
+            "codec %s can not start from non-off bias with idle_bias_off==1\n",
+            component->name);
 
        /* machine specific init */
        if (component->init) {