ASoC: simple-card: fix the DAPM routes map parsing
authorXiubo Li <Li.Xiubo@freescale.com>
Tue, 7 Jan 2014 01:13:42 +0000 (09:13 +0800)
committerMark Brown <broonie@linaro.org>
Tue, 7 Jan 2014 15:43:13 +0000 (15:43 +0000)
The simple-card's DAPM route maping is optional.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/generic/simple-card.c

index d4402fb5725362429bd668d189abc44703f5654f..eb95beb25d43d60f92a4dff742b804e1e1c21c21 100644 (file)
@@ -134,10 +134,12 @@ static int asoc_simple_card_parse_of(struct device_node *node,
                (SND_SOC_DAIFMT_FORMAT_MASK | SND_SOC_DAIFMT_INV_MASK);
 
        /* DAPM routes */
-       ret = snd_soc_of_parse_audio_routing(&info->snd_card,
+       if (of_property_read_bool(node, "simple-audio-routing")) {
+               ret = snd_soc_of_parse_audio_routing(&info->snd_card,
                                        "simple-audio-routing");
-       if (ret)
-               return ret;
+               if (ret)
+                       return ret;
+       }
 
        /* CPU sub-node */
        ret = -EINVAL;