]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: simple-scu-card: tidyup codec daifmt handling method
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 25 Aug 2016 01:57:04 +0000 (01:57 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 1 Sep 2016 20:21:39 +0000 (21:21 +0100)
Current simple-scu-card is handling codec daifmt by using
for_each_child_of_node(), and low-level method.
Let's use of_get_child_by_name() instead it

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

index ac7ba97e8dddb344ed6c8b9bcf5c87304d094ac8..83add148722f9c71b0d475e0c29f94861c320c0b 100644 (file)
@@ -212,19 +212,14 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
        bool is_fe;
 
        /* find 1st codec */
-       i = 0;
-       for_each_child_of_node(node, np) {
-               dai_link = simple_priv_to_link(priv, i);
+       np = of_get_child_by_name(node, PREFIX "codec");
+       if (!np)
+               return -ENODEV;
 
-               if (strcmp(np->name, PREFIX "codec") == 0) {
-                       ret = asoc_simple_card_parse_daifmt(dev, node, np,
-                                                           PREFIX, &daifmt);
-                       if (ret < 0)
-                               return ret;
-                       break;
-               }
-               i++;
-       }
+       ret = asoc_simple_card_parse_daifmt(dev, node, np,
+                                           PREFIX, &daifmt);
+       if (ret < 0)
+               return ret;
 
        i = 0;
        for_each_child_of_node(node, np) {