From patchwork Wed Jul 31 19:12:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13749085 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 605E9C3DA64 for ; Wed, 31 Jul 2024 19:16:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=uFYcXIMSiorcj23tu5ZcURteDamK8oJ1VLQL0Iqvihs=; b=Mj3hjsmKMx3otQOkQHKckVHMVj Sp/gJBDaOURFp3HTkKG10Hq3hXWXYYLRpb+KF6udkq9soAIKKgf9DuTj/t0FXsWXXCro583KZYMd6 V0opjp0gSyQGY+MeQWcZopGPPtTZTpqWVTOrgdI8Zue8LF6MyoK7xzChjkSPbcvx98lWX1J75dlac t0Q2zZxvCKA5+slteP0gDRsxhtEl2kloIeTqvLi+qJzd92xgrZDIp6zh6m0k2mXWC19sETNco0GWl DfzW60UBILldqLZo0nOQdJ6U6WnghS3XSLlZ7xBLn2dzslsqmylfdUIEscy0eJ3NsHxw088Nd1XrE HhUHG5QQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEoB-00000002Erq-30Kg; Wed, 31 Jul 2024 19:16:23 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZElo-00000002Dym-0Ua0 for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 19:13:57 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 7F778CE13FD; Wed, 31 Jul 2024 19:13:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A923EC4AF09; Wed, 31 Jul 2024 19:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722453233; bh=kdjbGvEdRLgyREDQqkBuCZiTKYlAO4pgknOpuCR42LA=; h=From:To:Cc:Subject:Date:From; b=caf5xRQGUr+uSGQD4LDsPEdVwHh1TUG0gg5a8oemletv6sayaVMH+sj0LJAcmi9/c FhX+Xb856DHFCuOBOLR5LKi/UeN/UYpQeT3Inz0rgVq4Djx1irVgA7w5FeGNbbm0/I 1PboGV+ogVV117gbsLkz8wXbwNH9xk4WnDYCb3yMjqRJoePYgBNaMJg6xTvI/13hNr x73p+54bC33ieU+jmJUszf1A1MrErgt4hnL+Burltxs2sLxwqA7eveXFBpDnd2pK/Q +Hj5sdTlr8QgnP6u6GWg8sTX7CZjovW20+ED+GA3I4zId1y5tioldO5gd9jSHosQH8 QRz3gIMT6UPYQ== From: "Rob Herring (Arm)" To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-pm@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] devfreq: imx-bus: Use of_property_present() Date: Wed, 31 Jul 2024 13:12:49 -0600 Message-ID: <20240731191312.1710417-11-robh@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240731_121356_357740_87E13A18 X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use of_property_present() to test for property presence rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) Acked-by: Peng Fan --- drivers/devfreq/imx-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/imx-bus.c b/drivers/devfreq/imx-bus.c index 86850b7dea09..49798f542d68 100644 --- a/drivers/devfreq/imx-bus.c +++ b/drivers/devfreq/imx-bus.c @@ -59,7 +59,7 @@ static int imx_bus_init_icc(struct device *dev) struct imx_bus *priv = dev_get_drvdata(dev); const char *icc_driver_name; - if (!of_get_property(dev->of_node, "#interconnect-cells", NULL)) + if (!of_property_present(dev->of_node, "#interconnect-cells")) return 0; if (!IS_ENABLED(CONFIG_INTERCONNECT_IMX)) { dev_warn(dev, "imx interconnect drivers disabled\n");