diff options
| author | Cássio Gabriel <cassiogabrielcontato@gmail.com> | 2026-06-08 16:39:13 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-06-12 18:12:11 +0300 |
| commit | 9741aad24432ae2cef0fe3d5c2c2d1c2ecc803f2 (patch) | |
| tree | cb6f4d935a01f7a4702a5c0010a0dde92f2f8b67 | |
| parent | 065df02692f06d38e032edd5cd2d554b81c8b48e (diff) | |
| download | linux-9741aad24432ae2cef0fe3d5c2c2d1c2ecc803f2.tar.xz | |
ASoC: bcm: cygnus: use scoped child node loop
cygnus_ssp_probe() manually puts the current child node before returning
from the child 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-3-9e3ac518dc2e@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/bcm/cygnus-ssp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index e0ce0232eb1e..47706ae0a31f 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -1298,7 +1298,6 @@ static int audio_clk_init(struct platform_device *pdev, static int cygnus_ssp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *child_node; struct cygnus_audio *cygaud; int err; int node_count; @@ -1331,16 +1330,15 @@ static int cygnus_ssp_probe(struct platform_device *pdev) active_port_count = 0; - for_each_available_child_of_node(pdev->dev.of_node, child_node) { + for_each_available_child_of_node_scoped(pdev->dev.of_node, child_node) { err = parse_ssp_child_node(pdev, child_node, cygaud, &cygnus_ssp_dai[active_port_count]); /* negative is err, 0 is active and good, 1 is disabled */ - if (err < 0) { - of_node_put(child_node); + if (err < 0) return err; - } - else if (!err) { + + if (!err) { dev_dbg(dev, "Activating DAI: %s\n", cygnus_ssp_dai[active_port_count].name); active_port_count++; |
