mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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>
This commit is contained in:
parent
065df02692
commit
9741aad244
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user