From patchwork Wed Jun 28 15:32:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 697620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E24EC001DB for ; Wed, 28 Jun 2023 15:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbjF1Pcp (ORCPT ); Wed, 28 Jun 2023 11:32:45 -0400 Received: from mga09.intel.com ([134.134.136.24]:19758 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232245AbjF1PcX (ORCPT ); Wed, 28 Jun 2023 11:32:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687966343; x=1719502343; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cHot3HUA6uOrNhNVHxLnKbqcAV9rKZZMtPBuH3yLtBI=; b=eI/yEPUZBMd4LGNsuMkMpQ2uOlQWJ/FyS7eO//dYWg5b02w12C2aie+s qcrCVe4NOsGcvyn47h5k5h4kCUP+yYDXv7UdjOJwuQAhFKPESHrRa6ru8 WRuPN5NL++PdUkWCq4zvHfnnoEJ0m+1keDzyp8ObMH+DXvdICHpMUav9U ApohsoA8Rqk2/jXzbfazYPhUTOS3ZpGIPaa1vKDCBKZRLZ4Rs9vgUKFMO VWpHzCTXMCWuLDBbtOH3k9tp2YukOL0DInSF+nbfy9lK1xxFsr7/viEAM RE5Ras541Wx56zaZKGOgTEivYW3Q1VC3DiouxfRdrS8kAag0gGe3KBHik Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="364426966" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="364426966" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 08:32:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10755"; a="782344683" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="782344683" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 28 Jun 2023 08:32:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9FBAE516; Wed, 28 Jun 2023 18:32:14 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , Saravana Kannan , Andy Shevchenko , Stephen Boyd , Dario Binacchi , Tony Lindgren , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org Cc: "Rafael J. Wysocki" , Peter De Schrijver , Prashant Gaikwad , Michael Turquette , Thierry Reding , Jonathan Hunter , Tero Kristo , Andy Shevchenko Subject: [PATCH v1 3/4] clk: tegra: Replace kstrdup() + strreplace() with kstrdup_and_replace() Date: Wed, 28 Jun 2023 18:32:10 +0300 Message-Id: <20230628153211.52988-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230628153211.52988-1-andriy.shevchenko@linux.intel.com> References: <20230628153211.52988-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Replace open coded functionalify of kstrdup_and_replace() with a call. Signed-off-by: Andy Shevchenko --- drivers/clk/tegra/clk.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c index 26bda45813c0..071e72d1598a 100644 --- a/drivers/clk/tegra/clk.c +++ b/drivers/clk/tegra/clk.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include @@ -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;