Commit 253160a8 authored by Leonard Crestez's avatar Leonard Crestez Committed by Stephen Boyd

clk: core: Copy connection id

Some drivers use sprintf to build clk connection id names but the clk
core will save those strings and occasionally print them back. Duplicate
the con_id strings instead of fixing all the users.
Signed-off-by: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent cda82ace
...@@ -2502,7 +2502,7 @@ struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id, ...@@ -2502,7 +2502,7 @@ struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,
clk->core = hw->core; clk->core = hw->core;
clk->dev_id = dev_id; clk->dev_id = dev_id;
clk->con_id = con_id; clk->con_id = kstrdup_const(con_id, GFP_KERNEL);
clk->max_rate = ULONG_MAX; clk->max_rate = ULONG_MAX;
clk_prepare_lock(); clk_prepare_lock();
...@@ -2518,6 +2518,7 @@ void __clk_free_clk(struct clk *clk) ...@@ -2518,6 +2518,7 @@ void __clk_free_clk(struct clk *clk)
hlist_del(&clk->clks_node); hlist_del(&clk->clks_node);
clk_prepare_unlock(); clk_prepare_unlock();
kfree_const(clk->con_id);
kfree(clk); kfree(clk);
} }
......
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