ASoC: simple-card: rename to asoc_simple_card_canonicalize_platform()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 21 Jan 2019 07:40:59 +0000 (16:40 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 21 Jan 2019 18:14:16 +0000 (18:14 +0000)
Current simple-card is using asoc_simple_card_canonicalize_dailink().
Its naming is "dailink", but is for "platform".
We already have asoc_simple_card_canonicalize_cpu() for "cpu",
let's follow same naming rule.
It never return error, so, void function is better idea.

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

index ab5a2ba09c0779cc10a5b79b9affba17ed79e8d7..7afe45389972d49b192c2dfc0c905587c35fd393 100644 (file)
@@ -108,7 +108,7 @@ int asoc_simple_card_parse_graph_dai(struct device_node *ep,
 int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
                              struct asoc_simple_dai *simple_dai);
 
-int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link);
+void asoc_simple_card_canonicalize_platform(struct snd_soc_dai_link *dai_link);
 void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link,
                                      int is_single_links);
 
index 42b077c6be4c4a3f1b6853c6bbea40b7ea7f210e..bb12351330e8c0f307b0237ee2e2f1b6b2f9aeec 100644 (file)
@@ -307,14 +307,12 @@ static int graph_dai_link_of_dpcm(struct graph_priv *priv,
                                             "prefix");
        }
 
+       asoc_simple_card_canonicalize_platform(dai_link);
+
        ret = asoc_simple_card_of_parse_tdm(ep, dai);
        if (ret)
                return ret;
 
-       ret = asoc_simple_card_canonicalize_dailink(dai_link);
-       if (ret < 0)
-               return ret;
-
        ret = asoc_simple_card_parse_daifmt(dev, cpu_ep, codec_ep,
                                            NULL, &dai_link->dai_fmt);
        if (ret < 0)
@@ -405,10 +403,6 @@ static int graph_dai_link_of(struct graph_priv *priv,
        if (ret < 0)
                return ret;
 
-       ret = asoc_simple_card_canonicalize_dailink(dai_link);
-       if (ret < 0)
-               return ret;
-
        ret = asoc_simple_card_set_dailink_name(dev, dai_link,
                                                "%s-%s",
                                                dai_link->cpu_dai_name,
@@ -419,6 +413,7 @@ static int graph_dai_link_of(struct graph_priv *priv,
        dai_link->ops = &graph_ops;
        dai_link->init = graph_dai_init;
 
+       asoc_simple_card_canonicalize_platform(dai_link);
        asoc_simple_card_canonicalize_cpu(dai_link,
                of_graph_get_endpoint_count(dai_link->cpu_of_node) == 1);
 
index 3c0901df57960aac56b7a2652465843fc219a4eb..5c1424f036202f4e415d72b7a5c60d9919369b5a 100644 (file)
@@ -394,16 +394,13 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_init_dai);
 
-int asoc_simple_card_canonicalize_dailink(struct snd_soc_dai_link *dai_link)
+void asoc_simple_card_canonicalize_platform(struct snd_soc_dai_link *dai_link)
 {
        /* Assumes platform == cpu */
        if (!dai_link->platforms->of_node)
                dai_link->platforms->of_node = dai_link->cpu_of_node;
-
-       return 0;
-
 }
-EXPORT_SYMBOL_GPL(asoc_simple_card_canonicalize_dailink);
+EXPORT_SYMBOL_GPL(asoc_simple_card_canonicalize_platform);
 
 void asoc_simple_card_canonicalize_cpu(struct snd_soc_dai_link *dai_link,
                                       int is_single_links)
index d8a0d1ec256e06c3dbf6c9a7fefb87582ab4db0e..08df261024cfa6377323a6f3b8553f7edf8dffa9 100644 (file)
@@ -297,14 +297,12 @@ static int simple_dai_link_of_dpcm(struct simple_priv *priv,
 
        simple_get_conversion(dev, np, &dai_props->adata);
 
+       asoc_simple_card_canonicalize_platform(dai_link);
+
        ret = asoc_simple_card_of_parse_tdm(np, dai);
        if (ret)
                return ret;
 
-       ret = asoc_simple_card_canonicalize_dailink(dai_link);
-       if (ret < 0)
-               return ret;
-
        snprintf(prop, sizeof(prop), "%smclk-fs", prefix);
        of_property_read_u32(top,  PREFIX "mclk-fs", &dai_props->mclk_fs);
        of_property_read_u32(node, prop, &dai_props->mclk_fs);
@@ -409,10 +407,6 @@ static int simple_dai_link_of(struct simple_priv *priv,
        if (ret < 0)
                goto dai_link_of_err;
 
-       ret = asoc_simple_card_canonicalize_dailink(dai_link);
-       if (ret < 0)
-               goto dai_link_of_err;
-
        ret = asoc_simple_card_set_dailink_name(dev, dai_link,
                                                "%s-%s",
                                                dai_link->cpu_dai_name,
@@ -424,6 +418,7 @@ static int simple_dai_link_of(struct simple_priv *priv,
        dai_link->init = simple_dai_init;
 
        asoc_simple_card_canonicalize_cpu(dai_link, single_cpu);
+       asoc_simple_card_canonicalize_platform(dai_link);
 
 dai_link_of_err:
        of_node_put(node);