Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Stephen Boyd
28df1500 7f146b24

+2 -4
+2 -4
drivers/clk/tegra/clk.c
··· 14 14 #include <linux/platform_device.h> 15 15 #include <linux/pm_runtime.h> 16 16 #include <linux/reset-controller.h> 17 - #include <linux/string.h> 17 + #include <linux/string_helpers.h> 18 18 19 19 #include <soc/tegra/fuse.h> 20 20 ··· 384 384 struct device_node *np; 385 385 char *node_name; 386 386 387 - node_name = kstrdup(hw->init->name, GFP_KERNEL); 387 + node_name = kstrdup_and_replace(hw->init->name, '_', '-', GFP_KERNEL); 388 388 if (!node_name) 389 389 return NULL; 390 - 391 - strreplace(node_name, '_', '-'); 392 390 393 391 for_each_child_of_node(tegra_car_np, np) { 394 392 if (!strcmp(np->name, node_name))