Skip to contentSkip to conversation

clk: at91: dt-compat: Hold reference returned by of_get_parent()

PATCH Superseded Liang He 2 participants 7 messages Jun 28, 2022 – Jun 30, 2022

Subsystems (2)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH v2 1/1 clk: at91: dt-compat: Hold reference returned by of_get_parent()

We need to hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance.

---
changelog:

v2: use 'parent_np' to replace 'tp' and use xx:yy:zz title format
v1: hold references returned by of_get_parent() and put them

 drivers/clk/at91/dt-compat.c | 112 +++++++++++++++++++++++++++--------
 1 file changed, 86 insertions(+), 26 deletions(-)
drivers/clk/at91/dt-compat.c +86 -26
index 8ca8bcacf66d..0d36b4e7fd6e 100644
@@ -33,8 +33,11 @@ static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np)
 	const char *name = np->name;
 	const char *parent_name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -56,8 +59,11 @@ static void __init of_sama5d2_clk_audio_pll_pad_setup(struct device_node *np)
 	const char *name = np->name;
 	const char *parent_name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -79,8 +85,11 @@ static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np)
 	const char *name = np->name;
 	const char *parent_name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -120,7 +129,7 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np)
 	struct clk_hw *hw;
 	unsigned int num_parents;
 	const char *parent_names[GENERATED_SOURCE_MAX];
-	struct device_node *gcknp;
+	struct device_node *gcknp, *parent_np;
 	struct clk_range range = CLK_RANGE(0, 0);
 	struct regmap *regmap;
 
@@ -134,7 +143,9 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np)
 	if (!num || num > PERIPHERAL_MAX)
 		return;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -180,8 +191,11 @@ static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np)
 	const char *name = np->name;
 	const char *parent_name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -243,12 +257,15 @@ static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np)
 	const char *parent_name;
 	struct regmap *regmap;
 	bool bypass;
+	struct device_node *parent_np;
 
 	of_property_read_string(np, "clock-output-names", &name);
 	bypass = of_property_read_bool(np, "atmel,osc-bypass");
 	parent_name = of_clk_get_parent_name(np, 0);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -268,12 +285,15 @@ static void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np)
 	u32 accuracy = 0;
 	const char *name = np->name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	of_property_read_string(np, "clock-output-names", &name);
 	of_property_read_u32(np, "clock-frequency", &frequency);
 	of_property_read_u32(np, "clock-accuracy", &accuracy);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -292,11 +312,14 @@ static void __init of_at91rm9200_clk_main_setup(struct device_node *np)
 	const char *parent_name;
 	const char *name = np->name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	parent_name = of_clk_get_parent_name(np, 0);
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -316,13 +339,16 @@ static void __init of_at91sam9x5_clk_main_setup(struct device_node *np)
 	unsigned int num_parents;
 	const char *name = np->name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	num_parents = of_clk_get_parent_count(np);
 	if (num_parents == 0 || num_parents > 2)
 		return;
 
 	of_clk_parent_fill(np, parent_names, num_parents);
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -373,6 +399,7 @@ of_at91_clk_master_setup(struct device_node *np,
 	const char *name = np->name;
 	struct clk_master_characteristics *characteristics;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	num_parents = of_clk_get_parent_count(np);
 	if (num_parents == 0 || num_parents > MASTER_SOURCE_MAX)
@@ -386,7 +413,9 @@ of_at91_clk_master_setup(struct device_node *np,
 	if (!characteristics)
 		return;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -433,6 +462,7 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type)
 	const char *name;
 	struct device_node *periphclknp;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	parent_name = of_clk_get_parent_name(np, 0);
 	if (!parent_name)
@@ -442,7 +472,9 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type)
 	if (!num || num > PERIPHERAL_MAX)
 		return;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -601,6 +633,7 @@ of_at91_clk_pll_setup(struct device_node *np,
 	struct regmap *regmap;
 	const char *parent_name;
 	const char *name = np->name;
+	struct device_node *parent_np;
 	struct clk_pll_characteristics *characteristics;
 
 	if (of_property_read_u32(np, "reg", &id))
@@ -610,7 +643,9 @@ of_at91_clk_pll_setup(struct device_node *np,
 
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -665,12 +700,15 @@ of_at91sam9x5_clk_plldiv_setup(struct device_node *np)
 	const char *parent_name;
 	const char *name = np->name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	parent_name = of_clk_get_parent_name(np, 0);
 
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -694,8 +732,8 @@ of_at91_clk_prog_setup(struct device_node *np,
 	unsigned int num_parents;
 	const char *parent_names[PROG_SOURCE_MAX];
 	const char *name;
-	struct device_node *progclknp;
 	struct regmap *regmap;
+	struct device_node *progclknp, *parent_np;
 
 	num_parents = of_clk_get_parent_count(np);
 	if (num_parents == 0 || num_parents > PROG_SOURCE_MAX)
@@ -707,7 +745,9 @@ of_at91_clk_prog_setup(struct device_node *np,
 	if (!num || num > (PROG_ID_MAX + 1))
 		return;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -756,13 +796,16 @@ static void __init of_at91sam9260_clk_slow_setup(struct device_node *np)
 	unsigned int num_parents;
 	const char *name = np->name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	num_parents = of_clk_get_parent_count(np);
 	if (num_parents != 2)
 		return;
 
 	of_clk_parent_fill(np, parent_names, num_parents);
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -788,6 +831,7 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np)
 	const char *parent_names[SMD_SOURCE_MAX];
 	const char *name = np->name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	num_parents = of_clk_get_parent_count(np);
 	if (num_parents == 0 || num_parents > SMD_SOURCE_MAX)
@@ -797,7 +841,9 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np)
 
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -818,15 +864,17 @@ static void __init of_at91rm9200_clk_sys_setup(struct device_node *np)
 	u32 id;
 	struct clk_hw *hw;
 	const char *name;
-	struct device_node *sysclknp;
 	const char *parent_name;
 	struct regmap *regmap;
+	struct device_node *sysclknp, *parent_np;
 
 	num = of_get_child_count(np);
 	if (num > (SYSTEM_MAX_ID + 1))
 		return;
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -859,6 +907,7 @@ static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np)
 	const char *parent_names[USB_SOURCE_MAX];
 	const char *name = np->name;
 	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	num_parents = of_clk_get_parent_count(np);
 	if (num_parents == 0 || num_parents > USB_SOURCE_MAX)
@@ -868,7 +917,9 @@ static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np)
 
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -885,9 +936,10 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb",
 static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 {
 	struct clk_hw *hw;
+	struct regmap *regmap;
 	const char *parent_name;
 	const char *name = np->name;
-	struct regmap *regmap;
+	struct device_node *parent_np;
 
 	parent_name = of_clk_get_parent_name(np, 0);
 	if (!parent_name)
@@ -895,7 +947,9 @@ static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 
@@ -911,10 +965,11 @@ CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb",
 static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 {
 	struct clk_hw *hw;
+	struct regmap *regmap;
 	const char *parent_name;
 	const char *name = np->name;
+	struct device_node *parent_np;
 	u32 divisors[4] = {0, 0, 0, 0};
-	struct regmap *regmap;
 
 	parent_name = of_clk_get_parent_name(np, 0);
 	if (!parent_name)
@@ -926,7 +981,9 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap))
 		return;
 	hw = at91rm9200_clk_register_usb(regmap, name, parent_name, divisors);
@@ -945,13 +1002,16 @@ static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np)
 	struct clk_hw *hw;
 	const char *parent_name;
 	const char *name = np->name;
+	struct device_node *parent_np;
 	struct regmap *regmap_pmc, *regmap_sfr;
 
 	parent_name = of_clk_get_parent_name(np, 0);
 
 	of_property_read_string(np, "clock-output-names", &name);
 
-	regmap_pmc = syscon_node_to_regmap(of_get_parent(np));
+	parent_np = of_get_parent(np);
+	regmap_pmc = syscon_node_to_regmap(parent_np);
+	of_node_put(parent_np);
 	if (IS_ERR(regmap_pmc))
 		return;
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 234 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

We need to hold the reference returned by of_get_parent() and use it to call of_node_put() for refcount balance.

---
changelog:

v2: use 'parent_np' to replace 'tp' and use xx:yy:zz title format
v1: hold references returned by of_get_parent() and put them

 drivers/clk/at91/dt-compat.c | 112 +++++++++++++++++++++++++++--------
 1 file changed, 86 insertions(+), 26 deletions(-)
drivers/clk/at91/dt-compat.c +52 -14
index 8ca8bcacf66d..0d36b4e7fd6e 100644
@@ -33,8 +33,11 @@ static void __init of_sama5d2_clk_audio_pll_frac_setup(struct device_node *np)
        const char *name = np->name;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -56,8 +59,11 @@ static void __init of_sama5d2_clk_audio_pll_pad_setup(struct device_node *np)
        const char *name = np->name;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -79,8 +85,11 @@ static void __init of_sama5d2_clk_audio_pll_pmc_setup(struct device_node *np)
        const char *name = np->name;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -120,7 +129,7 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np)
        struct clk_hw *hw;
        unsigned int num_parents;
        const char *parent_names[GENERATED_SOURCE_MAX];
-       struct device_node *gcknp;
+       struct device_node *gcknp, *parent_np;
        struct clk_range range = CLK_RANGE(0, 0);
        struct regmap *regmap;
 
@@ -134,7 +143,9 @@ static void __init of_sama5d2_clk_generated_setup(struct device_node *np)
        if (!num || num > PERIPHERAL_MAX)
                return;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -180,8 +191,11 @@ static void __init of_sama5d4_clk_h32mx_setup(struct device_node *np)
        const char *name = np->name;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -243,12 +257,15 @@ static void __init of_at91rm9200_clk_main_osc_setup(struct device_node *np)
        const char *parent_name;
        struct regmap *regmap;
        bool bypass;
+       struct device_node *parent_np;
 
        of_property_read_string(np, "clock-output-names", &name);
        bypass = of_property_read_bool(np, "atmel,osc-bypass");
        parent_name = of_clk_get_parent_name(np, 0);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -268,12 +285,15 @@ static void __init of_at91sam9x5_clk_main_rc_osc_setup(struct device_node *np)
        u32 accuracy = 0;
        const char *name = np->name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        of_property_read_string(np, "clock-output-names", &name);
        of_property_read_u32(np, "clock-frequency", &frequency);
        of_property_read_u32(np, "clock-accuracy", &accuracy);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -292,11 +312,14 @@ static void __init of_at91rm9200_clk_main_setup(struct device_node *np)
        const char *parent_name;
        const char *name = np->name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        parent_name = of_clk_get_parent_name(np, 0);
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -316,13 +339,16 @@ static void __init of_at91sam9x5_clk_main_setup(struct device_node *np)
        unsigned int num_parents;
        const char *name = np->name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        num_parents = of_clk_get_parent_count(np);
        if (num_parents == 0 || num_parents > 2)
                return;
 
        of_clk_parent_fill(np, parent_names, num_parents);
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -373,6 +399,7 @@ of_at91_clk_master_setup(struct device_node *np,
        const char *name = np->name;
        struct clk_master_characteristics *characteristics;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        num_parents = of_clk_get_parent_count(np);
        if (num_parents == 0 || num_parents > MASTER_SOURCE_MAX)
@@ -386,7 +413,9 @@ of_at91_clk_master_setup(struct device_node *np,
        if (!characteristics)
                return;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -433,6 +462,7 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type)
        const char *name;
        struct device_node *periphclknp;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
@@ -442,7 +472,9 @@ of_at91_clk_periph_setup(struct device_node *np, u8 type)
        if (!num || num > PERIPHERAL_MAX)
                return;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -601,6 +633,7 @@ of_at91_clk_pll_setup(struct device_node *np,
        struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        struct clk_pll_characteristics *characteristics;
 
        if (of_property_read_u32(np, "reg", &id))
@@ -610,7 +643,9 @@ of_at91_clk_pll_setup(struct device_node *np,
 
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -665,12 +700,15 @@ of_at91sam9x5_clk_plldiv_setup(struct device_node *np)
        const char *parent_name;
        const char *name = np->name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        parent_name = of_clk_get_parent_name(np, 0);
 
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 

drivers/clk/at91/dt-compat.c of_at91_clk_prog_setup(struct device_node *np, · line 736

Quoted 6 lines
drivers/clk/at91/dt-compat.c +1 -1
@@ -694,8 +732,8 @@ of_at91_clk_prog_setup(struct device_node *np,
        unsigned int num_parents;
        const char *parent_names[PROG_SOURCE_MAX];
        const char *name;
-       struct device_node *progclknp;
        struct regmap *regmap;
+       struct device_node *progclknp, *parent_np;

Is there a reason you chosed to move this on a new line?

Quoted 52 lines
drivers/clk/at91/dt-compat.c +11 -3
        num_parents = of_clk_get_parent_count(np);
        if (num_parents == 0 || num_parents > PROG_SOURCE_MAX)
@@ -707,7 +745,9 @@ of_at91_clk_prog_setup(struct device_node *np,
        if (!num || num > (PROG_ID_MAX + 1))
                return;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -756,13 +796,16 @@ static void __init of_at91sam9260_clk_slow_setup(struct device_node *np)
        unsigned int num_parents;
        const char *name = np->name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        num_parents = of_clk_get_parent_count(np);
        if (num_parents != 2)
                return;
 
        of_clk_parent_fill(np, parent_names, num_parents);
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -788,6 +831,7 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np)
        const char *parent_names[SMD_SOURCE_MAX];
        const char *name = np->name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        num_parents = of_clk_get_parent_count(np);
        if (num_parents == 0 || num_parents > SMD_SOURCE_MAX)
@@ -797,7 +841,9 @@ static void __init of_at91sam9x5_clk_smd_setup(struct device_node *np)
 
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 

drivers/clk/at91/dt-compat.c static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) · line 869

Quoted 7 lines
drivers/clk/at91/dt-compat.c +1 -1
@@ -818,15 +864,17 @@ static void __init of_at91rm9200_clk_sys_setup(struct device_node *np)
        u32 id;
        struct clk_hw *hw;
        const char *name;
-       struct device_node *sysclknp;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *sysclknp, *parent_np;

Same here.

Quoted 32 lines
drivers/clk/at91/dt-compat.c +7 -2
        num = of_get_child_count(np);
        if (num > (SYSTEM_MAX_ID + 1))
                return;
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 
@@ -859,6 +907,7 @@ static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np)
        const char *parent_names[USB_SOURCE_MAX];
        const char *name = np->name;
        struct regmap *regmap;
+       struct device_node *parent_np;
 
        num_parents = of_clk_get_parent_count(np);
        if (num_parents == 0 || num_parents > USB_SOURCE_MAX)
@@ -868,7 +917,9 @@ static void __init of_at91sam9x5_clk_usb_setup(struct device_node *np)
 
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", · line 942

Quoted 8 lines
drivers/clk/at91/dt-compat.c +2 -1
@@ -885,9 +936,10 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb",
 static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 {
        struct clk_hw *hw;
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
-       struct regmap *regmap;
+       struct device_node *parent_np;

You moved around the declarations.

Quoted 15 lines
drivers/clk/at91/dt-compat.c +3 -1
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
@@ -895,7 +947,9 @@ static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
 

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", · line 917

Quoted 9 lines
drivers/clk/at91/dt-compat.c +2 -1
@@ -911,10 +965,11 @@ CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb",
 static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 {
        struct clk_hw *hw;
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        u32 divisors[4] = {0, 0, 0, 0};
-       struct regmap *regmap;

Same here.

Quoted 35 lines
drivers/clk/at91/dt-compat.c +7 -3
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
@@ -926,7 +981,9 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap))
                return;
        hw = at91rm9200_clk_register_usb(regmap, name, parent_name, divisors);
@@ -945,13 +1002,16 @@ static void __init of_at91sam9x5_clk_utmi_setup(struct device_node *np)
        struct clk_hw *hw;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        struct regmap *regmap_pmc, *regmap_sfr;
 
        parent_name = of_clk_get_parent_name(np, 0);
 
        of_property_read_string(np, "clock-output-names", &name);
 
-       regmap_pmc = syscon_node_to_regmap(of_get_parent(np));
+       parent_np = of_get_parent(np);
+       regmap_pmc = syscon_node_to_regmap(parent_np);
+       of_node_put(parent_np);
        if (IS_ERR(regmap_pmc))
                return;
 
--

2.25.1

author
#2 lore raw

Hi,  Claudiu.Beznea,

Quoted 14 lines · At 2022-06-30 16:39:26, [email protected] wrote:

drivers/clk/at91/dt-compat.c of_at91_clk_prog_setup(struct device_node *np, · line 736

Quoted 9 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe [...]

drivers/clk/at91/dt-compat.c +1 -1
@@ -694,8 +732,8 @@ of_at91_clk_prog_setup(struct device_node *np,
        unsigned int num_parents;
        const char *parent_names[PROG_SOURCE_MAX];
        const char *name;
-       struct device_node *progclknp;
        struct regmap *regmap;
+       struct device_node *progclknp, *parent_np;

Is there a reason you chosed to move this on a new line?

In fact, I just want to keep long declaration on bottom.

However, this modification maybe useless.

Quoted 11 lines

drivers/clk/at91/dt-compat.c static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) · line 869

Quoted 7 lines

[...]

        struct clk_hw *hw;
        const char *name;
drivers/clk/at91/dt-compat.c +1 -1
-       struct device_node *sysclknp;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *sysclknp, *parent_np;

Same here.

Same reason as above.

Quoted 4 lines
Quoted 3 lines
        num = of_get_child_count(np);
        if (num > (SYSTEM_MAX_ID + 1))
Quoted 13 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", · line 942

Quoted 9 lines
drivers/clk/at91/dt-compat.c +2 -1
@@ -885,9 +936,10 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb",
 static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 {
        struct clk_hw *hw;
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
-       struct regmap *regmap;
+       struct device_node *parent_np;

You moved around the declarations.

Sorry, I have been told to keep reverse christmas tree.

So this look like a normal christmas tree?

Quoted 1 line
Quoted 1 line
(quoted diff) +0 -0
 >>         parent_name = of_clk_get_parent_name(np, 0);

[...]

Quoted 10 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", · line 917

Quoted 6 lines
drivers/clk/at91/dt-compat.c +2 -1
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        u32 divisors[4] = {0, 0, 0, 0};
-       struct regmap *regmap;

Same here.

Same reason as above.

Quoted 6 lines

Review static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) · line 982

Quoted 6 lines
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
(quoted diff) +0 -0
@@ -926,7 +981,9 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 
 

If these declaration chages are not needed, I can resend a new patch keeping the original order of declarations.

Thanks.

Liang

#3 lore raw
Quoted 59 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hi, Claudiu.Beznea,

Quoted 14 lines · At 2022-06-30 16:39:26, [email protected] wrote:

drivers/clk/at91/dt-compat.c of_at91_clk_prog_setup(struct device_node *np, · line 736

Quoted 9 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe [...]

drivers/clk/at91/dt-compat.c +1 -1
@@ -694,8 +732,8 @@ of_at91_clk_prog_setup(struct device_node *np,
        unsigned int num_parents;
        const char *parent_names[PROG_SOURCE_MAX];
        const char *name;
-       struct device_node *progclknp;
        struct regmap *regmap;
+       struct device_node *progclknp, *parent_np;

Is there a reason you chosed to move this on a new line?

In fact, I just want to keep long declaration on bottom.

However, this modification maybe useless.

Quoted 11 lines

drivers/clk/at91/dt-compat.c static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) · line 869

Quoted 7 lines

[...]

        struct clk_hw *hw;
        const char *name;
drivers/clk/at91/dt-compat.c +1 -1
-       struct device_node *sysclknp;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *sysclknp, *parent_np;

Same here.

Same reason as above.

Quoted 4 lines
Quoted 3 lines
        num = of_get_child_count(np);
        if (num > (SYSTEM_MAX_ID + 1))
Quoted 13 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", · line 942

Quoted 9 lines
drivers/clk/at91/dt-compat.c +2 -1
@@ -885,9 +936,10 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb",
 static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 {
        struct clk_hw *hw;
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
-       struct regmap *regmap;
+       struct device_node *parent_np;

You moved around the declarations.

Quoted 1 line

Sorry, I have been told to keep reverse christmas tree.

I thought this rule is only for networking subsystem.

Quoted 36 lines

So this look like a normal christmas tree?

Quoted 1 line
Quoted 1 line
(quoted diff) +0 -0
 >>         parent_name = of_clk_get_parent_name(np, 0);

[...]

Quoted 10 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", · line 917

Quoted 6 lines
drivers/clk/at91/dt-compat.c +2 -1
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        u32 divisors[4] = {0, 0, 0, 0};
-       struct regmap *regmap;

Same here.

Same reason as above.

Quoted 6 lines

Review static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) · line 982

Quoted 6 lines
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
(quoted diff) +0 -0
@@ -926,7 +981,9 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 
 

If these declaration chages are not needed, I can resend a new patch keeping the original order of declarations.

Thanks.

Liang

author
#4 lore raw
Quoted 60 lines · At 2022-06-30 18:20:36, [email protected] wrote:
Quoted 59 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hi, Claudiu.Beznea,

Quoted 14 lines · At 2022-06-30 16:39:26, [email protected] wrote:

drivers/clk/at91/dt-compat.c of_at91_clk_prog_setup(struct device_node *np, · line 736

Quoted 9 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe [...]

drivers/clk/at91/dt-compat.c +1 -1
@@ -694,8 +732,8 @@ of_at91_clk_prog_setup(struct device_node *np,
        unsigned int num_parents;
        const char *parent_names[PROG_SOURCE_MAX];
        const char *name;
-       struct device_node *progclknp;
        struct regmap *regmap;
+       struct device_node *progclknp, *parent_np;

Is there a reason you chosed to move this on a new line?

In fact, I just want to keep long declaration on bottom.

However, this modification maybe useless.

Quoted 11 lines

drivers/clk/at91/dt-compat.c static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) · line 869

Quoted 7 lines

[...]

        struct clk_hw *hw;
        const char *name;
drivers/clk/at91/dt-compat.c +1 -1
-       struct device_node *sysclknp;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *sysclknp, *parent_np;

Same here.

Same reason as above.

Quoted 17 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", · line 942

Quoted 13 lines
        num = of_get_child_count(np);
        if (num > (SYSTEM_MAX_ID + 1))
drivers/clk/at91/dt-compat.c +2 -1
@@ -885,9 +936,10 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb",
 static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 {
        struct clk_hw *hw;
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
-       struct regmap *regmap;
+       struct device_node *parent_np;

You moved around the declarations.

Quoted 4 lines
Quoted 1 line

Sorry, I have been told to keep reverse christmas tree.

I thought this rule is only for networking subsystem.

OK, thanks, I will keep the rule only when I fix bugs in networking subsystem.

So it needs to send a v3 to restore the order of the declarations?

If yes, I will resend it soon.

Thanks.

Liang

Quoted 37 lines
Quoted 36 lines

So this look like a normal christmas tree?

Quoted 1 line
Quoted 1 line
(quoted diff) +0 -0
 >>         parent_name = of_clk_get_parent_name(np, 0);

[...]

Quoted 10 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", · line 917

Quoted 6 lines
drivers/clk/at91/dt-compat.c +2 -1
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        u32 divisors[4] = {0, 0, 0, 0};
-       struct regmap *regmap;

Same here.

Same reason as above.

Quoted 6 lines

Review static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) · line 982

Quoted 6 lines
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
(quoted diff) +0 -0
@@ -926,7 +981,9 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 
 

If these declaration chages are not needed, I can resend a new patch keeping the original order of declarations.

Thanks.

Liang

#5 lore raw
Quoted 63 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 60 lines · At 2022-06-30 18:20:36, [email protected] wrote:
Quoted 59 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hi, Claudiu.Beznea,

Quoted 14 lines · At 2022-06-30 16:39:26, [email protected] wrote:

drivers/clk/at91/dt-compat.c of_at91_clk_prog_setup(struct device_node *np, · line 736

Quoted 9 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe [...]

drivers/clk/at91/dt-compat.c +1 -1
@@ -694,8 +732,8 @@ of_at91_clk_prog_setup(struct device_node *np,
        unsigned int num_parents;
        const char *parent_names[PROG_SOURCE_MAX];
        const char *name;
-       struct device_node *progclknp;
        struct regmap *regmap;
+       struct device_node *progclknp, *parent_np;

Is there a reason you chosed to move this on a new line?

In fact, I just want to keep long declaration on bottom.

However, this modification maybe useless.

Quoted 11 lines

drivers/clk/at91/dt-compat.c static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) · line 869

Quoted 7 lines

[...]

        struct clk_hw *hw;
        const char *name;
drivers/clk/at91/dt-compat.c +1 -1
-       struct device_node *sysclknp;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *sysclknp, *parent_np;

Same here.

Same reason as above.

Quoted 17 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", · line 942

Quoted 13 lines
        num = of_get_child_count(np);
        if (num > (SYSTEM_MAX_ID + 1))
drivers/clk/at91/dt-compat.c +2 -1
@@ -885,9 +936,10 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb",
 static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 {
        struct clk_hw *hw;
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
-       struct regmap *regmap;
+       struct device_node *parent_np;

You moved around the declarations.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Sorry, I have been told to keep reverse christmas tree.

I thought this rule is only for networking subsystem.

OK, thanks, I will keep the rule only when I fix bugs in networking subsystem.

So it needs to send a v3 to restore the order of the declarations?

Yes, please.

Quoted 45 lines

If yes, I will resend it soon.

Thanks.

Liang

Quoted 37 lines
Quoted 36 lines

So this look like a normal christmas tree?

Quoted 1 line
Quoted 1 line
(quoted diff) +0 -0
 >>         parent_name = of_clk_get_parent_name(np, 0);

[...]

Quoted 10 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", · line 917

Quoted 6 lines
drivers/clk/at91/dt-compat.c +2 -1
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        u32 divisors[4] = {0, 0, 0, 0};
-       struct regmap *regmap;

Same here.

Same reason as above.

Quoted 6 lines

Review static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) · line 982

Quoted 6 lines
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
(quoted diff) +0 -0
@@ -926,7 +981,9 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 
 

If these declaration chages are not needed, I can resend a new patch keeping the original order of declarations.

Thanks.

Liang

author
#6 lore raw
Quoted 66 lines · At 2022-06-30 22:19:45, [email protected] wrote:
Quoted 65 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 62 lines · At 2022-06-30 18:20:36, [email protected] wrote:
Quoted 60 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hi, Claudiu.Beznea,

Quoted 14 lines · At 2022-06-30 16:39:26, [email protected] wrote:

drivers/clk/at91/dt-compat.c of_at91_clk_prog_setup(struct device_node *np, · line 736

Quoted 9 lines · Liang He

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe [...]

drivers/clk/at91/dt-compat.c +1 -1
@@ -694,8 +732,8 @@ of_at91_clk_prog_setup(struct device_node *np,
        unsigned int num_parents;
        const char *parent_names[PROG_SOURCE_MAX];
        const char *name;
-       struct device_node *progclknp;
        struct regmap *regmap;
+       struct device_node *progclknp, *parent_np;

Is there a reason you chosed to move this on a new line?

In fact, I just want to keep long declaration on bottom.

However, this modification maybe useless.

Quoted 11 lines

drivers/clk/at91/dt-compat.c static void __init of_at91rm9200_clk_sys_setup(struct device_node *np) · line 869

Quoted 7 lines

[...]

        struct clk_hw *hw;
        const char *name;
drivers/clk/at91/dt-compat.c +1 -1
-       struct device_node *sysclknp;
        const char *parent_name;
        struct regmap *regmap;
+       struct device_node *sysclknp, *parent_np;

Same here.

Same reason as above.

Quoted 4 lines
Quoted 3 lines
        num = of_get_child_count(np);
        if (num > (SYSTEM_MAX_ID + 1))
Quoted 13 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb", · line 942

Quoted 9 lines
drivers/clk/at91/dt-compat.c +2 -1
@@ -885,9 +936,10 @@ CLK_OF_DECLARE(at91sam9x5_clk_usb, "atmel,at91sam9x5-clk-usb",
 static void __init of_at91sam9n12_clk_usb_setup(struct device_node *np)
 {
        struct clk_hw *hw;
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
-       struct regmap *regmap;
+       struct device_node *parent_np;

You moved around the declarations.

Sorry, I have been told to keep reverse christmas tree.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I thought this rule is only for networking subsystem.

OK, thanks, I will keep the rule only when I fix bugs in networking subsystem.

So it needs to send a v3 to restore the order of the declarations?

Yes, please.

OK, soon.

Quoted 47 lines
Quoted 46 lines

If yes, I will resend it soon.

Thanks.

Liang

Quoted 37 lines
Quoted 36 lines

So this look like a normal christmas tree?

Quoted 1 line
Quoted 1 line
(quoted diff) +0 -0
 >>         parent_name = of_clk_get_parent_name(np, 0);

[...]

Quoted 10 lines

drivers/clk/at91/dt-compat.c CLK_OF_DECLARE(at91sam9n12_clk_usb, "atmel,at91sam9n12-clk-usb", · line 917

Quoted 6 lines
drivers/clk/at91/dt-compat.c +2 -1
+       struct regmap *regmap;
        const char *parent_name;
        const char *name = np->name;
+       struct device_node *parent_np;
        u32 divisors[4] = {0, 0, 0, 0};
-       struct regmap *regmap;

Same here.

Same reason as above.

Quoted 6 lines

Review static void __init of_at91rm9200_clk_usb_setup(struct device_node *np) · line 982

Quoted 6 lines
        parent_name = of_clk_get_parent_name(np, 0);
        if (!parent_name)
(quoted diff) +0 -0
@@ -926,7 +981,9 @@ static void __init of_at91rm9200_clk_usb_setup(struct device_node *np)
 
 

If these declaration chages are not needed, I can resend a new patch keeping the original order of declarations.

Thanks.

Liang