ASoC: simple-scu-card: tidyup codec daifmt handling method

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>
This commit is contained in:
Kuninori Morimoto 2016-08-25 01:57:04 +00:00 committed by Mark Brown
parent 93bc047d76
commit 112a2ab5a7

View file

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