Skip to content

Commit 28df150

Browse files
andy-shevbebarino
authored andcommitted
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>
1 parent 7f146b2 commit 28df150

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/tegra/clk.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <linux/platform_device.h>
1515
#include <linux/pm_runtime.h>
1616
#include <linux/reset-controller.h>
17-
#include <linux/string.h>
17+
#include <linux/string_helpers.h>
1818

1919
#include <soc/tegra/fuse.h>
2020

@@ -384,12 +384,10 @@ static struct device_node *tegra_clk_get_of_node(struct clk_hw *hw)
384384
struct device_node *np;
385385
char *node_name;
386386

387-
node_name = kstrdup(hw->init->name, GFP_KERNEL);
387+
node_name = kstrdup_and_replace(hw->init->name, '_', '-', GFP_KERNEL);
388388
if (!node_name)
389389
return NULL;
390390

391-
strreplace(node_name, '_', '-');
392-
393391
for_each_child_of_node(tegra_car_np, np) {
394392
if (!strcmp(np->name, node_name))
395393
break;

0 commit comments

Comments
 (0)