From patchwork Fri Mar 10 14:47:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13169357 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 CAEE3C6FD1F for ; Fri, 10 Mar 2023 14:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KNv/yrHpKDkOptYJvMPen0xB8+CAqEpH6d9AA9KN+7g=; b=jaDMOeSPlwU9z4 vvYBS4o3zpO5hcNj9dpjlnGIvPkea3SJlt8Stie93kbwVTIi3Et39OkSbEkcOHLcEHB4QyLTjkzew dIQh7ZyavxmVomkl56mk8nwp3RokBz5qREfNn+S2eNfYss5fwtzXaxCdsFLLDjtIRISj19othSweS nBNmeiW5ckk2Gek3R6eqEtANmvqqs2xv6wP2CTEMGymypc4SZ+xOjlsvN19k/NZOYN+mK9YaEg4ee JCpI0vbK4QavvJJtXRApEBxSJROmxvALDmsDpPrvj6VZCqs/MgAbiqn1XM8xsuEfYUaKk19k/vLfk 63LeDelsdbLycguQcZKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pae3f-00EndW-8U; Fri, 10 Mar 2023 14:49:23 +0000 Received: from mail-oa1-f46.google.com ([209.85.160.46]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pae2a-00En3Y-5s for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:48:17 +0000 Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-176d93cd0daso6080768fac.4 for ; Fri, 10 Mar 2023 06:48:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459695; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pED2hE/yKSIdpGB1fgEVNvATFJQwXMVTZnzZvUvbxCg=; b=239goRyJbmlQQwnXKLpRsYHHxCcOCUff5XdAnMvTmyRcDO5E4PDd/CGVNnO1oYgHVs vI8i9inLLTfP6BFV1BWT2mQmz6svX4khHKePVQq9kpYxdAwBrdD95P00jvQgR+z+o0Fm ZMNdt+NWHXhMHBo20/VqTjBfL+HDhdejVdKTSzsl2U3+M79AljCRHr+puIugUiTl4Kia EPYi0kWyI523VroXW2Z9O1nqFv6tNjNfe1lDTROAQhDs1NKHHXH8CReJsxA3S3ZOyKVE MJ6L2EbpF2RmGHudkkvaeu16Vwe4cqcCbpO0pd9HhdhXkKCWoVriqcXfzm6vHmTjw8Mh KvaA== X-Gm-Message-State: AO0yUKXnLrzGpN5+O8Gn1mzHL6EQWEakLxwbxH6Js0Y6Mk+lzFaxcFsE Kyk3sZ0bZKsckLxCBbF59GVE18gnrA== X-Google-Smtp-Source: AK7set/Hm9aC04epmTh3ilh/9NcDNxIApzetfeqMJFBuTYkxKPIem48QMaFDunttnQXTPu6yfagEtg== X-Received: by 2002:a05:6870:4195:b0:176:4a1f:4f87 with SMTP id y21-20020a056870419500b001764a1f4f87mr16562974oac.50.1678459694895; Fri, 10 Mar 2023 06:48:14 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id zq48-20020a0568718eb000b00172473f9fe0sm118604oab.13.2023.03.10.06.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:48:14 -0800 (PST) Received: (nullmailer pid 1545410 invoked by uid 1000); Fri, 10 Mar 2023 14:47:25 -0000 From: Rob Herring To: Nishanth Menon , Santosh Shilimkar Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] soc: ti: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:25 -0600 Message-Id: <20230310144725.1545384-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230310_064816_243244_CEB40736 X-CRM114-Status: GOOD ( 14.26 ) 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 It is preferred to use typed property access functions (i.e. of_property_read_ functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring --- drivers/soc/ti/knav_qmss_queue.c | 2 +- drivers/soc/ti/omap_prm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 8fb76908be70..48de98560093 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -1267,7 +1267,7 @@ static int knav_setup_queue_range(struct knav_device *kdev, if (of_get_property(node, "qalloc-by-id", NULL)) range->flags |= RANGE_RESERVED; - if (of_get_property(node, "accumulator", NULL)) { + if (of_property_present(node, "accumulator")) { ret = knav_init_acc_range(kdev, node, range); if (ret < 0) { devm_kfree(dev, range); diff --git a/drivers/soc/ti/omap_prm.c b/drivers/soc/ti/omap_prm.c index 913b964374a4..ecd9a8bdd7c0 100644 --- a/drivers/soc/ti/omap_prm.c +++ b/drivers/soc/ti/omap_prm.c @@ -684,7 +684,7 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm) const char *name; int error; - if (!of_find_property(dev->of_node, "#power-domain-cells", NULL)) + if (!of_property_present(dev->of_node, "#power-domain-cells")) return 0; of_node_put(dev->of_node);