Commit a72d7850 authored by Stephen Boyd's avatar Stephen Boyd

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: default avatarStephen Boyd <sboyd@kernel.org>
parent 9be76627
...@@ -520,8 +520,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) ...@@ -520,8 +520,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
provider->base = of_iomap(node, 0); provider->base = of_iomap(node, 0);
if (ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT) { if (ti_clk_get_features()->flags & TI_CLK_CLKCTRL_COMPAT) {
provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3, provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFnxxx", node->parent);
GFP_KERNEL);
if (!provider->clkdm_name) { if (!provider->clkdm_name) {
kfree(provider); kfree(provider);
return; return;
...@@ -531,10 +530,9 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) ...@@ -531,10 +530,9 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
* Create default clkdm name, replace _cm from end of parent * Create default clkdm name, replace _cm from end of parent
* node name with _clkdm * node name with _clkdm
*/ */
strcpy(provider->clkdm_name, node->parent->name); provider->clkdm_name[strlen(provider->clkdm_name) - 5] = 0;
provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0;
} else { } else {
provider->clkdm_name = kmalloc(strlen(node->name), GFP_KERNEL); provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFn", node);
if (!provider->clkdm_name) { if (!provider->clkdm_name) {
kfree(provider); kfree(provider);
return; return;
...@@ -544,7 +542,6 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) ...@@ -544,7 +542,6 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
* Create default clkdm name, replace _clkctrl from end of * Create default clkdm name, replace _clkctrl from end of
* node name with _clkdm * node name with _clkdm
*/ */
strcpy(provider->clkdm_name, node->name);
provider->clkdm_name[strlen(provider->clkdm_name) - 7] = 0; provider->clkdm_name[strlen(provider->clkdm_name) - 7] = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment