summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCássio Gabriel <cassiogabrielcontato@gmail.com>2026-06-08 10:39:12 -0300
committerMark Brown <broonie@kernel.org>2026-06-12 16:12:10 +0100
commit065df02692f06d38e032edd5cd2d554b81c8b48e (patch)
treeec7d9941af061a2b6740d4499a6121935d59a89f
parent22aed576add03c2f8083c1122087fbe4d18e4bf4 (diff)
ASoC: fsl: fsl_qmc_audio: use scoped child node loop
qmc_audio_probe() manually puts the current child node before returning from the DAI parsing loop on error. Use for_each_available_child_of_node_scoped() so the current child node is released automatically on early return and normal loop exit. Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com> Link: https://patch.msgid.link/20260608-asoc-of-node-scoped-cleanup-v1-2-9e3ac518dc2e@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/fsl/fsl_qmc_audio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/fsl/fsl_qmc_audio.c b/sound/soc/fsl/fsl_qmc_audio.c
index 76e014dfb6d7..d0f644573f49 100644
--- a/sound/soc/fsl/fsl_qmc_audio.c
+++ b/sound/soc/fsl/fsl_qmc_audio.c
@@ -905,7 +905,6 @@ static int qmc_audio_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct qmc_audio *qmc_audio;
- struct device_node *child;
unsigned int i;
int ret;
@@ -931,14 +930,12 @@ static int qmc_audio_probe(struct platform_device *pdev)
}
i = 0;
- for_each_available_child_of_node(np, child) {
+ for_each_available_child_of_node_scoped(np, child) {
ret = qmc_audio_dai_parse(qmc_audio, child,
qmc_audio->dais + i,
qmc_audio->dai_drivers + i);
- if (ret) {
- of_node_put(child);
+ if (ret)
return ret;
- }
i++;
}