summaryrefslogtreecommitdiff
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2016-10-25 00:37:18 +0000
committerMark Brown <broonie@kernel.org>2016-10-25 15:02:43 +0100
commit161ba1f1a5c99c4525eb39cc71ec984e0a39e6d7 (patch)
treef7b42086789452f59933799c50c65c663d76fdde /sound/soc/sh
parentdae4b83295ae50a86b5e3c60e7b6e2c597a1b69d (diff)
ASoC: rsnd: don't call unneeded of_node_put() on dma.c
Current rsnd_dmaen_start() is calling of_node_put() for np, but it is not needed if it goes through this loop. This patch tidyup it Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/rcar/dma.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index c85a55111392..2f0327714625 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -143,19 +143,17 @@ static int rsnd_dmaen_start(struct rsnd_mod *mod,
struct dma_chan *rsnd_dma_request_channel(struct device_node *of_node,
struct rsnd_mod *mod, char *name)
{
- struct dma_chan *chan;
+ struct dma_chan *chan = NULL;
struct device_node *np;
int i = 0;
for_each_child_of_node(of_node, np) {
- if (i == rsnd_mod_id(mod))
- break;
+ if (i == rsnd_mod_id(mod) && (!chan))
+ chan = of_dma_request_slave_channel(np, name);
i++;
}
- chan = of_dma_request_slave_channel(np, name);
-
- of_node_put(np);
+ /* It should call of_node_put(), since, it is rsnd_xxx_of_node() */
of_node_put(of_node);
return chan;