Skip to contentSkip to conversation

net: mdio: realtek-rtl9300: use scoped device_for_each_child_node loop

PATCH Applied Felix Gu 3 participants 3 messages Apr 5 – Apr 9

Subsystems (3)
lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 net: mdio: realtek-rtl9300: use scoped device_for_each_child_node loop

Switch to device_for_each_child_node_scoped() to auto-release fwnode references on early exit.

Fixes 24e31e474769 ("net: mdio: Add RTL9300 MDIO driver")
---
 drivers/net/mdio/mdio-realtek-rtl9300.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/mdio/mdio-realtek-rtl9300.c +1 -2
index 405a07075dd1..8d5fb014ca06 100644
@@ -466,7 +466,6 @@ static int rtl9300_mdiobus_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct rtl9300_mdio_priv *priv;
-	struct fwnode_handle *child;
 	int err;
 
 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -487,7 +486,7 @@ static int rtl9300_mdiobus_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	device_for_each_child_node(dev, child) {
+	device_for_each_child_node_scoped(dev, child) {
 		err = rtl9300_mdiobus_probe_one(dev, priv, child);
 		if (err)
 			return err;

---
base-commit: 2febe6e6ee6e34c7754eff3c4d81aa7b0dcb7979
change-id: 20260405-rtl9300-191bd002f5bd

Best regards,

Signature · 1 line
Felix Gu <[email protected]>
#2 lore raw
In reply to Felix Gu
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Sun, 05 Apr 2026 14:51:52 +0800 you wrote:

Switch to device_for_each_child_node_scoped() to auto-release fwnode references on early exit.

Fixes 24e31e474769 ("net: mdio: Add RTL9300 MDIO driver")
---
 drivers/net/mdio/mdio-realtek-rtl9300.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

[...]

Here is the summary with links:
- net: mdio: realtek-rtl9300: use scoped device_for_each_child_node loop

    https://git.kernel.org/netdev/net/c/c09ea768bdb9

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html