]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ASoC: dapm: Try to add all routes even if one fails
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 22 Jun 2012 11:21:49 +0000 (12:21 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 23 Jun 2012 11:11:31 +0000 (12:11 +0100)
We may as well print as many errors as we can in one go rather than
requiring developers to iterate through all their typos.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
sound/soc/soc-dapm.c

index 7365fed1ba74802edff6884d7aaef524727919e3..32fbf10127f17b38eeeb935143a056fea45607b5 100644 (file)
@@ -2276,15 +2276,15 @@ err:
 int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
                            const struct snd_soc_dapm_route *route, int num)
 {
-       int i, ret = 0;
+       int i, r, ret = 0;
 
        mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
        for (i = 0; i < num; i++) {
-               ret = snd_soc_dapm_add_route(dapm, route);
-               if (ret < 0) {
+               r = snd_soc_dapm_add_route(dapm, route);
+               if (r < 0) {
                        dev_err(dapm->dev, "Failed to add route %s->%s\n",
                                route->source, route->sink);
-                       break;
+                       ret = r;
                }
                route++;
        }