ASoC: simple-card: call of_node_put() for dai_link
We need to call of_node_put() if we used of_get_child_by_name(), but missing it for "dai-link" loop. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
e5668caec5
commit
a03b0545c2
|
@ -322,18 +322,21 @@ static int asoc_simple_card_parse_of(struct device_node *node,
|
||||||
struct simple_card_data *priv)
|
struct simple_card_data *priv)
|
||||||
{
|
{
|
||||||
struct device *dev = simple_priv_to_dev(priv);
|
struct device *dev = simple_priv_to_dev(priv);
|
||||||
|
struct device_node *dai_link;
|
||||||
u32 val;
|
u32 val;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
dai_link = of_get_child_by_name(node, PREFIX "dai-link");
|
||||||
|
|
||||||
/* The off-codec widgets */
|
/* The off-codec widgets */
|
||||||
if (of_property_read_bool(node, PREFIX "widgets")) {
|
if (of_property_read_bool(node, PREFIX "widgets")) {
|
||||||
ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card,
|
ret = snd_soc_of_parse_audio_simple_widgets(&priv->snd_card,
|
||||||
PREFIX "widgets");
|
PREFIX "widgets");
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto card_parse_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* DAPM routes */
|
/* DAPM routes */
|
||||||
|
@ -341,7 +344,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
|
||||||
ret = snd_soc_of_parse_audio_routing(&priv->snd_card,
|
ret = snd_soc_of_parse_audio_routing(&priv->snd_card,
|
||||||
PREFIX "routing");
|
PREFIX "routing");
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto card_parse_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Factor to mclk, used in hw_params() */
|
/* Factor to mclk, used in hw_params() */
|
||||||
|
@ -350,7 +353,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
|
||||||
priv->mclk_fs = val;
|
priv->mclk_fs = val;
|
||||||
|
|
||||||
/* Single/Muti DAI link(s) & New style of DT node */
|
/* Single/Muti DAI link(s) & New style of DT node */
|
||||||
if (of_get_child_by_name(node, PREFIX "dai-link")) {
|
if (dai_link) {
|
||||||
struct device_node *np = NULL;
|
struct device_node *np = NULL;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
@ -360,7 +363,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
|
||||||
i, false);
|
i, false);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
of_node_put(np);
|
of_node_put(np);
|
||||||
return ret;
|
goto card_parse_end;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -368,14 +371,15 @@ static int asoc_simple_card_parse_of(struct device_node *node,
|
||||||
/* For single DAI link & old style of DT node */
|
/* For single DAI link & old style of DT node */
|
||||||
ret = asoc_simple_card_dai_link_of(node, priv, 0, true);
|
ret = asoc_simple_card_dai_link_of(node, priv, 0, true);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto card_parse_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = asoc_simple_card_parse_card_name(&priv->snd_card, PREFIX);
|
ret = asoc_simple_card_parse_card_name(&priv->snd_card, PREFIX);
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return 0;
|
card_parse_end:
|
||||||
|
of_node_put(dai_link);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int asoc_simple_card_probe(struct platform_device *pdev)
|
static int asoc_simple_card_probe(struct platform_device *pdev)
|
||||||
|
|
Loading…
Reference in a new issue