Commit 33ae5727 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: audio-graph-card2: remove ports node name check

Current audio-graph-card2 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: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://msgid.link/r/877cfeh6gb.wl-kuninori.morimoto.gx@renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 72999a1b
...@@ -381,7 +381,6 @@ static void graph_parse_convert(struct device_node *ep, ...@@ -381,7 +381,6 @@ static void graph_parse_convert(struct device_node *ep,
struct device_node *ports = port_to_ports(port); struct device_node *ports = port_to_ports(port);
struct simple_util_data *adata = &props->adata; struct simple_util_data *adata = &props->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(port, NULL, adata);
simple_util_parse_convert(ep, NULL, adata); simple_util_parse_convert(ep, NULL, adata);
...@@ -396,7 +395,6 @@ static void graph_parse_mclk_fs(struct device_node *ep, ...@@ -396,7 +395,6 @@ static void graph_parse_mclk_fs(struct device_node *ep,
struct device_node *port = ep_to_port(ep); struct device_node *port = ep_to_port(ep);
struct device_node *ports = port_to_ports(port); struct device_node *ports = port_to_ports(port);
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(port, "mclk-fs", &props->mclk_fs);
of_property_read_u32(ep, "mclk-fs", &props->mclk_fs); of_property_read_u32(ep, "mclk-fs", &props->mclk_fs);
...@@ -496,7 +494,6 @@ static int __graph_parse_node(struct simple_util_priv *priv, ...@@ -496,7 +494,6 @@ static int __graph_parse_node(struct simple_util_priv *priv,
struct device_node *rport = ep_to_port(ep); struct device_node *rport = ep_to_port(ep);
struct device_node *rports = port_to_ports(rport); struct device_node *rports = port_to_ports(rport);
if (of_node_name_eq(rports, "ports"))
snd_soc_of_parse_node_prefix(rports, cconf, codecs->of_node, "prefix"); snd_soc_of_parse_node_prefix(rports, cconf, codecs->of_node, "prefix");
snd_soc_of_parse_node_prefix(rport, cconf, codecs->of_node, "prefix"); snd_soc_of_parse_node_prefix(rport, cconf, codecs->of_node, "prefix");
...@@ -717,6 +714,9 @@ static void graph_parse_daifmt(struct device_node *node, ...@@ -717,6 +714,9 @@ static void graph_parse_daifmt(struct device_node *node,
{ {
unsigned int fmt; unsigned int fmt;
if (!node)
return;
/* /*
* see also above "daifmt" explanation * see also above "daifmt" explanation
* and samples. * and samples.
...@@ -798,7 +798,6 @@ static void graph_link_init(struct simple_util_priv *priv, ...@@ -798,7 +798,6 @@ static void graph_link_init(struct simple_util_priv *priv,
*/ */
graph_parse_daifmt(ep, &daifmt, &bit_frame); /* (C) */ graph_parse_daifmt(ep, &daifmt, &bit_frame); /* (C) */
graph_parse_daifmt(port, &daifmt, &bit_frame); /* (B) */ graph_parse_daifmt(port, &daifmt, &bit_frame); /* (B) */
if (of_node_name_eq(ports, "ports"))
graph_parse_daifmt(ports, &daifmt, &bit_frame); /* (A) */ graph_parse_daifmt(ports, &daifmt, &bit_frame); /* (A) */
/* /*
......
...@@ -60,6 +60,9 @@ void simple_util_parse_convert(struct device_node *np, ...@@ -60,6 +60,9 @@ void simple_util_parse_convert(struct device_node *np,
{ {
char prop[128]; char prop[128];
if (!np)
return;
if (!prefix) if (!prefix)
prefix = ""; prefix = "";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment