From: Robert Marko Date: Fri, 17 Apr 2026 17:08:29 +0000 (+0200) Subject: generic: 6.18: backport EMC2305 changes X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4df09199db3dc686727232e8a3878b667da4225d;p=thirdparty%2Fopenwrt.git generic: 6.18: backport EMC2305 changes Now that 6.12 EMC2305 driver is backported to 7.0 code, lets do the same for 6.18 so they dont diverge. Link: https://github.com/openwrt/openwrt/pull/22942 Signed-off-by: Robert Marko --- diff --git a/target/linux/generic/backport-6.18/830-v7.0-hwmon-emc2305-Simplify-with-scoped-for-each-OF-child.patch b/target/linux/generic/backport-6.18/830-v7.0-hwmon-emc2305-Simplify-with-scoped-for-each-OF-child.patch new file mode 100644 index 00000000000..98084ecd234 --- /dev/null +++ b/target/linux/generic/backport-6.18/830-v7.0-hwmon-emc2305-Simplify-with-scoped-for-each-OF-child.patch @@ -0,0 +1,40 @@ +From bfd0103be5d85751fc8b7c6c8c7553d71022efe0 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Wed, 24 Dec 2025 12:07:03 +0100 +Subject: [PATCH] hwmon: (emc2305) Simplify with scoped for each OF child loop + +Use scoped for-each loop when iterating over device nodes to make code a +bit simpler. + +Signed-off-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20251224110702.61746-4-krzysztof.kozlowski@oss.qualcomm.com +Signed-off-by: Guenter Roeck +--- + drivers/hwmon/emc2305.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +--- a/drivers/hwmon/emc2305.c ++++ b/drivers/hwmon/emc2305.c +@@ -606,7 +606,6 @@ static int emc2305_probe(struct i2c_clie + { + struct i2c_adapter *adapter = client->adapter; + struct device *dev = &client->dev; +- struct device_node *child; + struct emc2305_data *data; + struct emc2305_platform_data *pdata; + int vendor; +@@ -682,12 +681,10 @@ static int emc2305_probe(struct i2c_clie + /* Parse and check for the available PWM child nodes */ + if (pwm_childs > 0) { + i = 0; +- for_each_child_of_node(dev->of_node, child) { ++ for_each_child_of_node_scoped(dev->of_node, child) { + ret = emc2305_set_single_tz(dev, child, i); +- if (ret != 0) { +- of_node_put(child); ++ if (ret != 0) + return ret; +- } + i++; + } + } else {