Commit 6846757d authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Guenter Roeck
Browse files

hwmon: (nct7363) 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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251224110702.61746-6-krzysztof.kozlowski@oss.qualcomm.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 0689522a
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -396,7 +396,6 @@ static const struct regmap_config nct7363_regmap_config = {
static int nct7363_probe(struct i2c_client *client)
{
	struct device *dev = &client->dev;
	struct device_node *child;
	struct nct7363_data *data;
	struct device *hwmon_dev;
	int ret;
@@ -409,13 +408,11 @@ static int nct7363_probe(struct i2c_client *client)
	if (IS_ERR(data->regmap))
		return PTR_ERR(data->regmap);

	for_each_child_of_node(dev->of_node, child) {
	for_each_child_of_node_scoped(dev->of_node, child) {
		ret = nct7363_present_pwm_fanin(dev, child, data);
		if (ret) {
			of_node_put(child);
		if (ret)
			return ret;
	}
	}

	/* Initialize the chip */
	ret = nct7363_init_chip(data);