[PATCH 02/20] clk: convert to of_property_for_each_u32_new()

Luca Ceresoli luca.ceresoli at bootlin.com
Wed Jul 3 03:36:46 PDT 2024


Simplify code using of_property_for_each_u32_new() as the two additional
parameters in of_property_for_each_u32() are not used here.

Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
---
 drivers/clk/clk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 8cca52be993f..8ea168c00997 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -5504,14 +5504,12 @@ static int parent_ready(struct device_node *np)
 int of_clk_detect_critical(struct device_node *np, int index,
 			   unsigned long *flags)
 {
-	struct property *prop;
-	const __be32 *cur;
 	uint32_t idx;
 
 	if (!np || !flags)
 		return -EINVAL;
 
-	of_property_for_each_u32(np, "clock-critical", prop, cur, idx)
+	of_property_for_each_u32_new(np, "clock-critical", idx)
 		if (index == idx)
 			*flags |= CLK_IS_CRITICAL;
 

-- 
2.34.1




More information about the linux-riscv mailing list