Skip to content

Commit

Permalink
ASoC: rsnd: DT node clean up by using the of_node_put()
Browse files Browse the repository at this point in the history
Driver needs to call of_node_put() after of_get_chile_by_name()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed May 26, 2014
1 parent e6b0d89 commit f451e48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions sound/soc/sh/rcar/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,18 +598,21 @@ static void rsnd_of_parse_src(struct platform_device *pdev,

nr = of_get_child_count(src_node);
if (!nr)
return;
goto rsnd_of_parse_src_end;

src_info = devm_kzalloc(dev,
sizeof(struct rsnd_src_platform_info) * nr,
GFP_KERNEL);
if (!src_info) {
dev_err(dev, "src info allocation error\n");
return;
goto rsnd_of_parse_src_end;
}

info->src_info = src_info;
info->src_info_nr = nr;

rsnd_of_parse_src_end:
of_node_put(src_node);
}

int rsnd_src_probe(struct platform_device *pdev,
Expand Down
7 changes: 5 additions & 2 deletions sound/soc/sh/rcar/ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,14 +554,14 @@ static void rsnd_of_parse_ssi(struct platform_device *pdev,

nr = of_get_child_count(node);
if (!nr)
return;
goto rsnd_of_parse_ssi_end;

ssi_info = devm_kzalloc(dev,
sizeof(struct rsnd_ssi_platform_info) * nr,
GFP_KERNEL);
if (!ssi_info) {
dev_err(dev, "ssi info allocation error\n");
return;
goto rsnd_of_parse_ssi_end;
}

info->ssi_info = ssi_info;
Expand All @@ -584,6 +584,9 @@ static void rsnd_of_parse_ssi(struct platform_device *pdev,
*/
ssi_info->pio_irq = irq_of_parse_and_map(np, 0);
}

rsnd_of_parse_ssi_end:
of_node_put(node);
}

int rsnd_ssi_probe(struct platform_device *pdev,
Expand Down

0 comments on commit f451e48

Please sign in to comment.