diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2024-05-28 07:05:40 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-06-03 16:59:39 +0200 |
commit | 84c9601a92b755f869ac811607402e5b2162c225 (patch) | |
tree | 343685dac097beecb709302ab0a74686a49e83b2 /sound/soc/generic/audio-graph-card.c | |
parent | ASoC: audio-graph-card: add ep_to_port() / port_to_ports() (diff) | |
download | linux-84c9601a92b755f869ac811607402e5b2162c225.tar.xz linux-84c9601a92b755f869ac811607402e5b2162c225.zip |
ASoC: audio-graph-card: remove ports node name check
Current audio-graph-card is checking if the node name was "ports" or
not when parsing the property.
if (of_node_name_eq(ports, "ports"))
of_xxx(ports, ...);
Now, it is using new port_to_ports() which will be NULL if the node
doesn't have "ports", and each of_xxx functions will do nothing if
node was NULL.
Now we don't need to check ports node name. Let's remove and cleanup it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/871q5mh6fv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic/audio-graph-card.c')
-rw-r--r-- | sound/soc/generic/audio-graph-card.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 552b94908cf7..c60f00146859 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -85,8 +85,7 @@ static void graph_parse_convert(struct device *dev, struct device_node *node = of_graph_get_port_parent(ep); simple_util_parse_convert(top, NULL, adata); - if (of_node_name_eq(ports, "ports")) - simple_util_parse_convert(ports, NULL, adata); + simple_util_parse_convert(ports, NULL, adata); simple_util_parse_convert(port, NULL, adata); simple_util_parse_convert(ep, NULL, adata); @@ -103,8 +102,7 @@ static void graph_parse_mclk_fs(struct device_node *top, struct device_node *ports = port_to_ports(port); of_property_read_u32(top, "mclk-fs", &props->mclk_fs); - if (of_node_name_eq(ports, "ports")) - of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); + of_property_read_u32(ports, "mclk-fs", &props->mclk_fs); of_property_read_u32(port, "mclk-fs", &props->mclk_fs); of_property_read_u32(ep, "mclk-fs", &props->mclk_fs); @@ -245,12 +243,9 @@ static int graph_dai_link_of_dpcm(struct simple_util_priv *priv, /* check "prefix" from top node */ port = ep_to_port(ep); ports = port_to_ports(port); - snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, - "prefix"); - if (of_node_name_eq(ports, "ports")) - snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix"); - snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, - "prefix"); + snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node, "prefix"); + snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix"); + snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node, "prefix"); of_node_put(ports); of_node_put(port); |