* [PATCH 1/3] clk: lmk04832: Simplify with scoped for each OF child loop
@ 2025-12-24 11:22 Krzysztof Kozlowski
2025-12-24 11:22 ` [PATCH 2/3] clk: scpi: " Krzysztof Kozlowski
2025-12-24 11:22 ` [PATCH 3/3] clk: versatile: impd1: " Krzysztof Kozlowski
0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-24 11:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
Linus Walleij, linux-clk, linux-kernel, arm-scmi,
linux-arm-kernel
Cc: Krzysztof Kozlowski
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/clk/clk-lmk04832.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/clk/clk-lmk04832.c b/drivers/clk/clk-lmk04832.c
index b2107b31efa2..9bf86caad829 100644
--- a/drivers/clk/clk-lmk04832.c
+++ b/drivers/clk/clk-lmk04832.c
@@ -1400,7 +1400,6 @@ static int lmk04832_probe(struct spi_device *spi)
{
const struct lmk04832_device_info *info;
int rdbk_pin = RDBK_CLKIN_SEL1;
- struct device_node *child;
struct lmk04832 *lmk;
u8 tmp[3];
int ret;
@@ -1462,14 +1461,13 @@ static int lmk04832_probe(struct spi_device *spi)
device_property_read_u32(lmk->dev, "ti,sysref-pulse-count",
&lmk->sysref_pulse_cnt);
- for_each_child_of_node(lmk->dev->of_node, child) {
+ for_each_child_of_node_scoped(lmk->dev->of_node, child) {
int reg;
ret = of_property_read_u32(child, "reg", ®);
if (ret) {
dev_err(lmk->dev, "missing reg property in child: %s\n",
child->full_name);
- of_node_put(child);
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] clk: scpi: Simplify with scoped for each OF child loop
2025-12-24 11:22 [PATCH 1/3] clk: lmk04832: Simplify with scoped for each OF child loop Krzysztof Kozlowski
@ 2025-12-24 11:22 ` Krzysztof Kozlowski
2025-12-24 18:04 ` Sudeep Holla
2025-12-24 11:22 ` [PATCH 3/3] clk: versatile: impd1: " Krzysztof Kozlowski
1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-24 11:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
Linus Walleij, linux-clk, linux-kernel, arm-scmi,
linux-arm-kernel
Cc: Krzysztof Kozlowski
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/clk/clk-scpi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c
index 0b592de7bdb2..7806569cd0d5 100644
--- a/drivers/clk/clk-scpi.c
+++ b/drivers/clk/clk-scpi.c
@@ -265,20 +265,19 @@ static int scpi_clocks_probe(struct platform_device *pdev)
{
int ret;
struct device *dev = &pdev->dev;
- struct device_node *child, *np = dev->of_node;
+ struct device_node *np = dev->of_node;
const struct of_device_id *match;
if (!get_scpi_ops())
return -ENXIO;
- for_each_available_child_of_node(np, child) {
+ for_each_available_child_of_node_scoped(np, child) {
match = of_match_node(scpi_clk_match, child);
if (!match)
continue;
ret = scpi_clk_add(dev, child, match);
if (ret) {
scpi_clocks_remove(pdev);
- of_node_put(child);
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] clk: versatile: impd1: Simplify with scoped for each OF child loop
2025-12-24 11:22 [PATCH 1/3] clk: lmk04832: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2025-12-24 11:22 ` [PATCH 2/3] clk: scpi: " Krzysztof Kozlowski
@ 2025-12-24 11:22 ` Krzysztof Kozlowski
2025-12-24 18:05 ` Sudeep Holla
2025-12-31 21:14 ` Linus Walleij
1 sibling, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-24 11:22 UTC (permalink / raw)
To: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
Linus Walleij, linux-clk, linux-kernel, arm-scmi,
linux-arm-kernel
Cc: Krzysztof Kozlowski
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/clk/versatile/clk-impd1.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/versatile/clk-impd1.c b/drivers/clk/versatile/clk-impd1.c
index 85c395df9c00..328dd47f1e43 100644
--- a/drivers/clk/versatile/clk-impd1.c
+++ b/drivers/clk/versatile/clk-impd1.c
@@ -104,15 +104,12 @@ static int integrator_impd1_clk_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
- struct device_node *child;
int ret = 0;
- for_each_available_child_of_node(np, child) {
+ for_each_available_child_of_node_scoped(np, child) {
ret = integrator_impd1_clk_spawn(dev, np, child);
- if (ret) {
- of_node_put(child);
+ if (ret)
break;
- }
}
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] clk: scpi: Simplify with scoped for each OF child loop
2025-12-24 11:22 ` [PATCH 2/3] clk: scpi: " Krzysztof Kozlowski
@ 2025-12-24 18:04 ` Sudeep Holla
0 siblings, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2025-12-24 18:04 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Michael Turquette, Stephen Boyd, Cristian Marussi, Linus Walleij,
linux-clk, linux-kernel, arm-scmi, linux-arm-kernel
On Wed, Dec 24, 2025 at 12:22:41PM +0100, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] clk: versatile: impd1: Simplify with scoped for each OF child loop
2025-12-24 11:22 ` [PATCH 3/3] clk: versatile: impd1: " Krzysztof Kozlowski
@ 2025-12-24 18:05 ` Sudeep Holla
2025-12-31 21:14 ` Linus Walleij
1 sibling, 0 replies; 6+ messages in thread
From: Sudeep Holla @ 2025-12-24 18:05 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Michael Turquette, Stephen Boyd, Cristian Marussi, Linus Walleij,
linux-clk, linux-kernel, arm-scmi, linux-arm-kernel
On Wed, Dec 24, 2025 at 12:22:42PM +0100, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] clk: versatile: impd1: Simplify with scoped for each OF child loop
2025-12-24 11:22 ` [PATCH 3/3] clk: versatile: impd1: " Krzysztof Kozlowski
2025-12-24 18:05 ` Sudeep Holla
@ 2025-12-31 21:14 ` Linus Walleij
1 sibling, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2025-12-31 21:14 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Michael Turquette, Stephen Boyd, Sudeep Holla, Cristian Marussi,
linux-clk, linux-kernel, arm-scmi, linux-arm-kernel
On Wed, Dec 24, 2025 at 12:22 PM Krzysztof Kozlowski
<krzysztof.kozlowski@oss.qualcomm.com> wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
That's neat.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-31 21:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-24 11:22 [PATCH 1/3] clk: lmk04832: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2025-12-24 11:22 ` [PATCH 2/3] clk: scpi: " Krzysztof Kozlowski
2025-12-24 18:04 ` Sudeep Holla
2025-12-24 11:22 ` [PATCH 3/3] clk: versatile: impd1: " Krzysztof Kozlowski
2025-12-24 18:05 ` Sudeep Holla
2025-12-31 21:14 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).