Thread (26 messages) 26 messages, 2 authors, 2018-09-13

[cip-dev] [PATCH 02/19] rcar: src: skip disabled-SRC nodes

From: Fabrizio Castro <hidden>
Date: 2018-08-10 09:52:45
Subsystem: sound, sound - soc layer / dynamic audio power management (asoc), the rest · Maintainers: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown, Linus Torvalds

From: Sergei Shtylyov <redacted>

The current device tree representation of the R-Car Sample Rate Converters
(SRC) assumes that they are numbered consecutively, starting from 0. Alas,
this  is not  the case with the R8A7794 SoC where SRC0 isn't present.  In
order to keep the existing  device trees working, I'm suggesting to use a
disabled node for SRC0.  Teach the SRC probe  to just skip disabled nodes.

Signed-off-by: Sergei Shtylyov <redacted>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit de1965159a34951a86267d13db4f2a67234139d3)
Signed-off-by: Fabrizio Castro <redacted>
Reviewed-by: Biju Das <redacted>
---
 sound/soc/sh/rcar/src.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c
index 2fcd3d3..68d46e1d 100644
--- a/sound/soc/sh/rcar/src.c
+++ b/sound/soc/sh/rcar/src.c
@@ -1011,6 +1011,9 @@ int rsnd_src_probe(struct platform_device *pdev,
 
 	i = 0;
 	for_each_child_of_node(node, np) {
+		if (!of_device_is_available(np))
+			goto skip;
+
 		src = rsnd_src_get(priv, i);
 
 		snprintf(name, RSND_SRC_NAME_SIZE, "%s.%d",
@@ -1034,6 +1037,7 @@ int rsnd_src_probe(struct platform_device *pdev,
 		if (ret)
 			goto rsnd_src_probe_done;
 
+skip:
 		i++;
 	}
 
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help