* [PATCH -next] net: dsa: ocelot: Simplify with scoped for each OF child loop
@ 2024-08-20 7:48 Jinjie Ruan
2024-08-22 0:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Jinjie Ruan @ 2024-08-20 7:48 UTC (permalink / raw)
To: vladimir.oltean, claudiu.manoil, alexandre.belloni, andrew,
f.fainelli, davem, edumazet, kuba, pabeni, UNGLinuxDriver,
netdev, linux-kernel
Cc: ruanjinjie
Use scoped for_each_available_child_of_node_scoped() when iterating over
device nodes to make code a bit simpler.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
drivers/net/dsa/ocelot/felix.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index e554699f06d4..800711c2b6cb 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -1265,9 +1265,8 @@ static int felix_parse_ports_node(struct felix *felix,
phy_interface_t *port_phy_modes)
{
struct device *dev = felix->ocelot.dev;
- struct device_node *child;
- for_each_available_child_of_node(ports_node, child) {
+ for_each_available_child_of_node_scoped(ports_node, child) {
phy_interface_t phy_mode;
u32 port;
int err;
@@ -1276,7 +1275,6 @@ static int felix_parse_ports_node(struct felix *felix,
if (of_property_read_u32(child, "reg", &port) < 0) {
dev_err(dev, "Port number not defined in device tree "
"(property \"reg\")\n");
- of_node_put(child);
return -ENODEV;
}
@@ -1286,7 +1284,6 @@ static int felix_parse_ports_node(struct felix *felix,
dev_err(dev, "Failed to read phy-mode or "
"phy-interface-type property for port %d\n",
port);
- of_node_put(child);
return -ENODEV;
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH -next] net: dsa: ocelot: Simplify with scoped for each OF child loop
2024-08-20 7:48 [PATCH -next] net: dsa: ocelot: Simplify with scoped for each OF child loop Jinjie Ruan
@ 2024-08-22 0:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-22 0:30 UTC (permalink / raw)
To: Jinjie Ruan
Cc: vladimir.oltean, claudiu.manoil, alexandre.belloni, andrew,
f.fainelli, davem, edumazet, kuba, pabeni, UNGLinuxDriver,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 20 Aug 2024 15:48:05 +0800 you wrote:
> Use scoped for_each_available_child_of_node_scoped() when iterating over
> device nodes to make code a bit simpler.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> drivers/net/dsa/ocelot/felix.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
Here is the summary with links:
- [-next] net: dsa: ocelot: Simplify with scoped for each OF child loop
https://git.kernel.org/netdev/net-next/c/e58c3f3d5196
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-22 0:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-20 7:48 [PATCH -next] net: dsa: ocelot: Simplify with scoped for each OF child loop Jinjie Ruan
2024-08-22 0:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®