From patchwork Wed Jul 31 19:12:54 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: 13749097 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 5A0A8C3DA7F for ; Wed, 31 Jul 2024 19:18:00 +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=O7flZ/+qmL2W5je/vNfcDzUyWECjf4zBnvwO8DBNiH0=; b=wznwPp+EMY3DEC1Tfk8PsELQNO hmV2PWnF4zw56PfFnw5F9pbrU7Jqbz2L8XuVxGkTt2NtoYodF3D7/rsAcCKNsyVyRW4KPtn+wyIbB DStbbamMr1rrhFpmMfOcrIqVuZEb2D8RWBLnJuk9OJYlVyaojByH9lYnqtfGkdtFJzEubvaxitcjd 1bRcqAxov+jaMkob5KlhT1IwB2EDT/QaelsZMeCBXMLqOf+UKUSYJ7tklVQv+dssJWv5AXt77dt+f Pg8tT3boIkI38hmRJ2FydoiIhWcQivL4FK+qmj78kAvRDmDgMaC+jx8uGya/eN3tn3rXTAEk4dfdN qaAtX/IQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEpZ-00000002FMa-1ViP; Wed, 31 Jul 2024 19:17:49 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZElw-00000002E23-3Q3E for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 19:14:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 24FDE6257A; Wed, 31 Jul 2024 19:14:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96322C4AF0C; Wed, 31 Jul 2024 19:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722453243; bh=1c8G2pZa29Ew7kwVpnYpj8oBYtzfUhHAnb6RGT6xepI=; h=From:To:Cc:Subject:Date:From; b=n1CIpg6ug7GHwMQY90/n8p498muCtyLRnJpWeX+6l3bP8+L2LOKRi962Zl6N4BYo3 2E6eHHteDrhcW2yZJx8oVAjfCT78IWt6iid9qFuc/E4XQBxZU0QLyxIEyW6ymm/lpN dn/vO913nj28ytrmWvOG+1RX18M3FX2W/jYph/a74ZqIACylt+Vti8sTOOqNTKsvzi 0Aec2w8KUuSoAZ6yjQncf/6xPY0yywnsT7oE6iwBSa2gklg4jsl45sbHzE98y7kYwG 0PKOzOloSgq16Ls+Wtzzp9cOQHnluOOQ+EQOG5jewNxnUZNDB3Wl9y+ww3NJmriRD5 kUvu9pJw1Jilw== From: "Rob Herring (Arm)" To: Krzysztof Kozlowski , Sylwester Nawrocki , Alim Akhtar , Linus Walleij Cc: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: samsung: Use of_property_present() Date: Wed, 31 Jul 2024 13:12:54 -0600 Message-ID: <20240731191312.1710417-16-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_121405_157912_CF0CAC36 X-CRM114-Status: GOOD ( 10.43 ) 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_find_property(). This is part of a larger effort to remove callers of of_find_property() and similar functions. of_find_property() leaks the DT struct property and data pointers which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) --- drivers/pinctrl/samsung/pinctrl-samsung.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 623df65a5d6f..855d6d99a253 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -823,16 +823,16 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions( struct device_node *func_np; if (!of_get_child_count(cfg_np)) { - if (!of_find_property(cfg_np, - "samsung,pin-function", NULL)) + if (!of_property_present(cfg_np, + "samsung,pin-function")) continue; ++func_cnt; continue; } for_each_child_of_node(cfg_np, func_np) { - if (!of_find_property(func_np, - "samsung,pin-function", NULL)) + if (!of_property_present(func_np, + "samsung,pin-function")) continue; ++func_cnt; }