diff options
author | Krzysztof Kozlowski <[email protected]> | 2024-08-16 17:14:07 +0200 |
---|---|---|
committer | Sudeep Holla <[email protected]> | 2024-08-18 20:22:16 +0100 |
commit | a8bd37e645602afcafc9d5f428c10aeda606b279 (patch) | |
tree | e1342a2333d114b350a27034b898e9692867e6ad | |
parent | be9f086524b3ea17c27fb4cd57115bf873354791 (diff) |
firmware: arm_scmi: Simplify with scoped for each OF child loop
Use scoped for_each_child_of_node_scoped() when iterating over device
nodes to make code a bit simpler.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Cristian Marussi <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Sudeep Holla <[email protected]>
-rw-r--r-- | drivers/firmware/arm_scmi/driver.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 119c9b6ae3c1..918d7287ecf4 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -2733,14 +2733,14 @@ scmi_txrx_setup(struct scmi_info *info, struct device_node *of_node, static int scmi_channels_setup(struct scmi_info *info) { int ret; - struct device_node *child, *top_np = info->dev->of_node; + struct device_node *top_np = info->dev->of_node; /* Initialize a common generic channel at first */ ret = scmi_txrx_setup(info, top_np, SCMI_PROTOCOL_BASE); if (ret) return ret; - for_each_available_child_of_node(top_np, child) { + for_each_available_child_of_node_scoped(top_np, child) { u32 prot_id; if (of_property_read_u32(child, "reg", &prot_id)) @@ -2751,10 +2751,8 @@ static int scmi_channels_setup(struct scmi_info *info) "Out of range protocol %d\n", prot_id); ret = scmi_txrx_setup(info, child, prot_id); - if (ret) { - of_node_put(child); + if (ret) return ret; - } } return 0; |