Skip to content

Commit a72d785

Browse files
committed
clk: ti: Prepare for remove of OF node name
Another patch is going to change this code to use %pOFn for DT node names. Fix up the code to make this easy to pick this side of the merge instead of fixing it up in a merge commit later. Cc: Tero Kristo <t-kristo@ti.com> Cc: Rob Herring <robh+dt@kernel.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 9be7662 commit a72d785

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

drivers/clk/ti/clkctrl.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
520520
provider->base = of_iomap(node, 0);
521521

522522
if (ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT) {
523-
provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3,
524-
GFP_KERNEL);
523+
provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFnxxx", node->parent);
525524
if (!provider->clkdm_name) {
526525
kfree(provider);
527526
return;
@@ -531,10 +530,9 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
531530
* Create default clkdm name, replace _cm from end of parent
532531
* node name with _clkdm
533532
*/
534-
strcpy(provider->clkdm_name, node->parent->name);
535-
provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0;
533+
provider->clkdm_name[strlen(provider->clkdm_name) - 5] = 0;
536534
} else {
537-
provider->clkdm_name = kmalloc(strlen(node->name), GFP_KERNEL);
535+
provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFn", node);
538536
if (!provider->clkdm_name) {
539537
kfree(provider);
540538
return;
@@ -544,7 +542,6 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
544542
* Create default clkdm name, replace _clkctrl from end of
545543
* node name with _clkdm
546544
*/
547-
strcpy(provider->clkdm_name, node->name);
548545
provider->clkdm_name[strlen(provider->clkdm_name) - 7] = 0;
549546
}
550547

0 commit comments

Comments
 (0)