diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-08-25 01:57:04 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-01 21:21:39 +0100 |
commit | 112a2ab5a720279d0805018a9ee162e12b0ce463 (patch) | |
tree | 356147935b4b4a13063dfe5ef5d99d42512822f0 /sound/soc/generic | |
parent | 93bc047d768d1049a591cc8b710b6481a7ddab89 (diff) | |
download | linux-112a2ab5a720279d0805018a9ee162e12b0ce463.tar.gz linux-112a2ab5a720279d0805018a9ee162e12b0ce463.tar.bz2 linux-112a2ab5a720279d0805018a9ee162e12b0ce463.zip |
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>
Diffstat (limited to 'sound/soc/generic')
-rw-r--r-- | sound/soc/generic/simple-scu-card.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c index ac7ba97e8ddd..83add148722f 100644 --- a/sound/soc/generic/simple-scu-card.c +++ b/sound/soc/generic/simple-scu-card.c @@ -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) { |