[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <88143d6af26b32066c92b5ba81d8e08c55426ebe.1746715755.git.christophe.jaillet@wanadoo.fr>
Date: Thu, 8 May 2025 16:52:27 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Lorenzo Bianconi <lorenzo@...nel.org>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
netdev@...r.kernel.org
Subject: [PATCH v2 3/4] net: airoha: Use for_each_child_of_node_scoped()
Use for_each_child_of_node_scoped() to slightly simplify the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Changes in v2:
- New patch
Compile tested only.
---
drivers/net/ethernet/airoha/airoha_eth.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
index d435179875df..2335aa59b06f 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.c
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
@@ -2886,7 +2886,6 @@ static int airoha_alloc_gdm_port(struct airoha_eth *eth,
static int airoha_probe(struct platform_device *pdev)
{
- struct device_node *np;
struct airoha_eth *eth;
int i, err;
@@ -2948,7 +2947,7 @@ static int airoha_probe(struct platform_device *pdev)
airoha_qdma_start_napi(ð->qdma[i]);
i = 0;
- for_each_child_of_node(pdev->dev.of_node, np) {
+ for_each_child_of_node_scoped(pdev->dev.of_node, np) {
if (!of_device_is_compatible(np, "airoha,eth-mac"))
continue;
@@ -2956,10 +2955,8 @@ static int airoha_probe(struct platform_device *pdev)
continue;
err = airoha_alloc_gdm_port(eth, np, i++);
- if (err) {
- of_node_put(np);
+ if (err)
goto error_napi_stop;
- }
}
return 0;
--
2.49.0
Powered by blists - more mailing lists