Skip to content

Commit 1b2189f

Browse files
committed
clk: versatile: clk-icst: Ensure clock names are unique
Commit 2d3de19 ("ARM: dts: arm: Update ICST clock nodes 'reg' and node names") moved to using generic node names. That results in trying to register multiple clocks with the same name. Fix this by including the unit-address in the clock name. Fixes: 2d3de19 ("ARM: dts: arm: Update ICST clock nodes 'reg' and node names") Cc: [email protected] Cc: Linus Walleij <[email protected]> Cc: Stephen Boyd <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 68d1619 commit 1b2189f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/clk/versatile/clk-icst.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ static void __init of_syscon_icst_setup(struct device_node *np)
484484
struct device_node *parent;
485485
struct regmap *map;
486486
struct clk_icst_desc icst_desc;
487-
const char *name = np->name;
487+
const char *name;
488488
const char *parent_name;
489489
struct clk *regclk;
490490
enum icst_control_type ctype;
@@ -533,15 +533,17 @@ static void __init of_syscon_icst_setup(struct device_node *np)
533533
icst_desc.params = &icst525_apcp_cm_params;
534534
ctype = ICST_INTEGRATOR_CP_CM_MEM;
535535
} else {
536-
pr_err("unknown ICST clock %s\n", name);
536+
pr_err("unknown ICST clock %pOF\n", np);
537537
return;
538538
}
539539

540540
/* Parent clock name is not the same as node parent */
541541
parent_name = of_clk_get_parent_name(np, 0);
542+
name = kasprintf(GFP_KERNEL, "%pOFP", np);
542543

543544
regclk = icst_clk_setup(NULL, &icst_desc, name, parent_name, map, ctype);
544545
if (IS_ERR(regclk)) {
546+
kfree(name);
545547
pr_err("error setting up syscon ICST clock %s\n", name);
546548
return;
547549
}

0 commit comments

Comments
 (0)