mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-01 10:42:11 +00:00
clk: tegra: Replace kstrdup() + strreplace() with kstrdup_and_replace()
Replace open coded functionality of kstrdup_and_replace() with a call. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230804143910.15504-4-andriy.shevchenko@linux.intel.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
7f146b2429
commit
28df1500f5
@ -14,7 +14,7 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
#include <linux/reset-controller.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/string_helpers.h>
|
||||
|
||||
#include <soc/tegra/fuse.h>
|
||||
|
||||
@ -384,12 +384,10 @@ static struct device_node *tegra_clk_get_of_node(struct clk_hw *hw)
|
||||
struct device_node *np;
|
||||
char *node_name;
|
||||
|
||||
node_name = kstrdup(hw->init->name, GFP_KERNEL);
|
||||
node_name = kstrdup_and_replace(hw->init->name, '_', '-', GFP_KERNEL);
|
||||
if (!node_name)
|
||||
return NULL;
|
||||
|
||||
strreplace(node_name, '_', '-');
|
||||
|
||||
for_each_child_of_node(tegra_car_np, np) {
|
||||
if (!strcmp(np->name, node_name))
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user