ASoC: Complain if we fail to create DAPM controls
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 18 Dec 2008 11:19:30 +0000 (11:19 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 18 Dec 2008 17:21:07 +0000 (17:21 +0000)
This should never happen and it's helpful to identify the specific control
that failed when it does happen.

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

index 61d7d85aa578f9062c43ae7fcaba2703c42aa54d..8863eddbac029975f9f7b4fefeac73b73bbcb6cf 100644 (file)
@@ -1320,8 +1320,12 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
 
        for (i = 0; i < num; i++) {
                ret = snd_soc_dapm_new_control(codec, widget);
-               if (ret < 0)
+               if (ret < 0) {
+                       printk(KERN_ERR
+                              "ASoC: Failed to create DAPM control %s: %d\n",
+                              widget->name, ret);
                        return ret;
+               }
                widget++;
        }
        return 0;